一句话:将属性测试与 Haskell 类型系统引入自动程序修复,降低过拟合补丁比例并加快修复速度。
自动程序修复(APR)常产生过拟合补丁:这些补丁能通过测试套件,却未真正修复程序问题,检测过拟合需人工检查或依赖预言机,代价高昂。本文提出在 APR 中引入属性以补充单元测试。作者设计并实现了面向 Haskell 的修复工具 PropR,利用 QuickCheck 属性测试以及 Haskell 编译器提供的丰富类型系统与综合能力。实验比较了仅单元测试、仅属性测试及二者结合三种配置下的修复率、首次补丁时间和过拟合率。结果表明,属性测试比单元测试更快得到结果且过拟合率更低;由此产生的过拟合补丁还能揭示待修复程序的底层问题(如故障定位或测试质量),是将 APR 引入开发者工作流的重要一步。
Automatic program repair (APR) regularly faces the challenge of overfitting patches - patches that pass the test suite, but do not actually address the problems when evaluated manually. Currently, overfit detection requires manual inspection or an oracle making quality control of APR an expensive task. With this work, we want to introduce properties in addition to unit tests for APR to address the problem of overfitting. To that end, we design and implement PROPR, a program repair tool for Haskell that leverages both property-based testing (via QuickCheck) and the rich type sys-tem and synthesis offered by the Haskell compiler. We compare the repair-ratio, time-to-first-patch and overfitting-ratio when using unit tests, property-based tests, and their combination. Our results show that properties lead to quicker results and have a lower overfit ratio than unit tests. The created overfit patches provide valuable insight into the underlying problems of the program to repair (e.g., in terms of fault localization or test quality). We consider this step towards fitter, or at least insightful, patches a critical contribution to bring APR into developer workflows.