arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.00156cs.SE
收藏

版本控制系统中从人工补丁中提取简洁补丁

Extracting Concise Bug-Fixing Patches from Human-Written Patches in Version Control Systems

Yanjie Jiang, Hui Liu, Nan Niu, Lu Zhang, Yamin Hu

摘要:

高质量、大规模的真实bug库和从实际应用中收集的简洁补丁是软件工程研究的关键。在这样的存储库中,每个真正的bug都明确地与它的修复相关联。因此,一方面,真实的错误和它们的修复可以启发用于发现、定位和修复软件错误的新方法;另一方面,真实的错误和它们的修复对于软件测试、故障定位和程序修复的方法的严格和有意义的评估是不可缺少的。为此,许多这样的储存库,例如,第4J章已经被发现了然而,这种储存库相当小,因为它们的建造涉及昂贵的人工干预。虽然错误修复代码提交以及相关的测试用例可以从版本控制系统自动检索,现有的方法还不能自动提取简明的错误修复补丁从错误修复提交,因为这样的提交往往涉及错误无关的更改。在本文中,我们提出了一个自动的方法,称为BugBuilder,提取完整和简洁的错误修复补丁从人类编写的补丁在版本控制系统。它通过检测bug修复提交中涉及的重构来排除重构,并在错误版本上重新应用检测到的重构。它枚举剩余部分的所有子集,并在测试用例上验证它们。如果没有一个子集有可能成为一个完整的bug修复补丁,则剩余部分作为一个整体被视为一个完整和简洁的bug修复补丁。对Defects 4J中809个真实bug修复提交的评估结果表明,BugBuilder成功地为40%的bug修复提交生成了完整而简洁的bug修复补丁,其准确率(99%)甚至高于人类专家。

英文摘要:

High-quality and large-scale repositories of real bugs and their concise patches collected from real-world applications are critical for research in software engineering community. In such a repository, each real bug is explicitly associated with its fix. Therefore, on one side, the real bugs and their fixes} may inspire novel approaches for finding, locating, and repairing software bugs; on the other side, the real bugs and their fixes are indispensable for rigorous and meaningful evaluation of approaches for software testing, fault localization, and program repair. To this end, a number of such repositories, e.g., Defects4J, have been proposed. However, such repositories are rather small because their construction involves expensive human intervention. Although bug-fixing code commits as well as associated test cases could be retrieved from version control systems automatically, existing approaches could not yet automatically extract concise bug-fixing patches from bug-fixing commits because such commits often involve bug-irrelevant changes. In this paper, we propose an automatic approach, called BugBuilder, to extracting complete and concise bug-fixing patches from human-written patches in version control systems. It excludes refactorings by detecting refactorings involved in bug-fixing commits, and reapplying detected refactorings on the faulty version. It enumerates all subsets of the remaining part and validates them on test cases. If none of the subsets has the potential to be a complete bug-fixing patch, the remaining part as a whole is taken as a complete and concise bug-fixing patch. Evaluation results on 809 real bug-fixing commits in Defects4J suggest that BugBuilder successfully generated complete and concise bug-fixing patches for forty percent of the bug-fixing commits, and its precision (99%) was even higher than human experts.

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

↑