arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1608.07754cs.SE
收藏

用于程序修复的精确条件综合

Precise Condition Synthesis for Program Repair

Yingfei Xiong, Jie Wang, Runfa Yan, Jiachen Zhang, Shi Han, Gang Huang, Lu Zhang

摘要:

由于缺陷修复的困难性,许多研究致力于缺陷自动修复。给定一个有缺陷的程序,它在某些测试用例中失败了,典型的自动修复技术试图修改程序,使所有测试都通过。然而,由于在现实世界的项目测试套件通常是不够的,旨在通过测试套件往往导致不正确的补丁。在本文中,我们的目标是产生精确的补丁,也就是说,我们产生的任何补丁有一个相对较高的概率是正确的。更具体地说,我们专注于条件合成,这是能够修复现有方法中一半以上的缺陷。我们的关键见解有三个方面。首先,重要的是要知道在一个局部上下文中的变量应该被用于“如果”条件,我们提出了一个排序方法的基础上的依赖关系的变量。其次,我们观察到API文档可以用来指导修复过程,并提出了文档分析技术,以进一步过滤的变量。第三,重要的是要知道什么谓词应该执行的变量集,我们建议挖掘一组经常使用的谓词在类似的情况下,从现有的项目。我们开发了一个新的程序修复系统,ACS,可以在错误的位置产生精确的条件。此外,由于生成的条件非常精确,我们可以执行以前被认为过于过拟合的修复操作:直接返回测试oracle来修复缺陷。使用我们的方法,我们成功地修复了Defects4J的四个项目中的17个缺陷,这是迄今为止数据集中报告的最大数量的完全自动修复的缺陷。更重要的是,我们的方法在评估中的精度为73.9%,这明显高于以前的方法,通常低于40%。

英文摘要:

Due to the difficulty of repairing defect, many research efforts have been devoted into automatic defect repair. Given a buggy program that fails some test cases, a typical automatic repair technique tries to modify the program to make all tests pass. However, since the test suites in real world projects are usually insufficient, aiming at passing the test suites often leads to incorrect patches. In this paper we aim to produce precise patches, that is, any patch we produce has a relatively high probability to be correct. More concretely, we focus on condition synthesis, which was shown to be able to repair more than half of the defects in existing approaches. Our key insight is threefold. First, it is important to know what variables in a local context should be used in an "if" condition, and we propose a sorting method based on the dependency relations between variables. Second, we observe that the API document can be used to guide the repair process, and propose document analysis technique to further filter the variables. Third, it is important to know what predicates should be performed on the set of variables, and we propose to mine a set of frequently used predicates in similar contexts from existing projects. We develop a novel program repair system, ACS, that could generate precise conditions at faulty locations. Furthermore, given the generated conditions are very precise, we can perform a repair operation that is previously deemed to be too overfitting: directly returning the test oracle to repair the defect. Using our approach, we successfully repaired 17 defects on four projects of Defects4J, which is the largest number of fully automatically repaired defects reported on the dataset so far. More importantly, the precision of our approach in the evaluation is 73.9%, which is significantly higher than previous approaches, which are usually less than 40%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑