一句话:提出 BugBuilder,通过剥离重构改动、枚举子集并用测试验证,从版本库提交中自动提取完整且简洁的缺陷修复补丁。
高质量的缺陷与修复补丁数据集对软件测试、缺陷定位与程序修复研究至关重要。现有 Defects4J 等数据集规模偏小,因为构建依赖昂贵的人工介入;而版本控制系统中虽可自动获取修复提交与测试用例,但这些提交常混杂与缺陷无关的改动,导致无法自动提取简洁的修复补丁。本文提出自动化方法 BugBuilder:首先检测修复提交中涉及的重构,将其重新应用到缺陷版本上从而排除重构改动;随后枚举剩余改动的所有子集,并在测试用例上验证其是否构成完整的修复补丁;若没有任何子集可行,则将剩余部分整体视为完整而简洁的修复补丁。在 Defects4J 的 809 个真实修复提交上的评估表明,BugBuilder 为约 40% 的提交成功生成了完整简洁的修复补丁,且精确率达 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.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2103-00156,
title = {Extracting Concise Bug-Fixing Patches from Human-Written Patches in Version Control Systems},
author = {Yanjie Jiang and Hui Liu and Nan Niu and Lu Zhang and Yamin Hu},
booktitle = {ICSE},
year = {2021},
doi = {10.1109/icse43902.2021.00069}
}