一句话:以参考实现为隐式规约,通过符号分析推断预期行为并合成条件等价补丁,缓解测试过拟合。
自动程序修复常以测试作为正确性判据,导致测试过拟合,生成补丁难以泛化到测试之外。本文提出使用参考实现进行语义程序修复:对参考实现进行符号分析,自动推断其预期行为规约;再利用该规约合成补丁,使修复后的程序与参考程序满足条件等价。由于参考实现充当隐式正确性标准,该方法可缓解基于测试修复中的过拟合问题。与 Relifix 等回归修复技术不同,参考程序与待修复程序在实现上可以存在显著差异。作者在嵌入式 Linux Busybox 上以 GNU Coreutils 为参考进行修复,并反向进行实验,结果表明该方法可扩展到真实程序,并能生成更多正确补丁。
Automated program repair has been studied via the use of techniques involving search, semantic analysis and artificial intelligence. Most of these techniques rely on tests as the correctness criteria, which causes the test overfitting problem. Although various approaches such as learning from code corpus have been proposed to address this problem, they are unable to guarantee that the generated patches generalize beyond the given tests. This work studies automated repair of errors using a reference implementation. The reference implementation is symbolically analyzed to automatically infer a specification of the intended behavior. This specification is then used to synthesize a patch that enforces conditional equivalence of the patched and the reference programs. The use of the reference implementation as an implicit correctness criterion alleviates overfitting in test-based repair. Besides, since we generate patches by semantic analysis, the reference program may have a substantially different implementation from the patched program, which distinguishes our approach from existing techniques for regression repair like Relifix. Our experiments in repairing the embedded Linux Busybox with GNU Coreutils as reference (and vice-versa) revealed that the proposed approach scales to real-world programs and enables the generation of more correct patches.
@inproceedings{paperbot4436,
title = {Semantic program repair using a reference implementation},
author = {Sergey Mechtaev and Manh-Dung Nguyen and Yannic Noller and Lars Grunske and Abhik Roychoudhury},
booktitle = {ICSE},
year = {2018},
doi = {10.1145/3180155.3180247}
}