paperbot · PL 论文追踪

全部论文 待读 收藏

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

从版本控制系统的人工修复补丁中提取简洁的缺陷修复补丁
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 该论文聚焦从版本库提交中自动提取简洁缺陷修复补丁,属于程序修复与基准仓库构建方向,与用户关注的静态分析、LLM/Agent、浮点程序分析、贝叶斯程序分析等核心交叉点没有直接关联。虽然它涉及缺陷基准构建,但并非用户研究画像中的主要问题。引用 46 inbox
Yanjie Jiang, Hui Liu, Nan Niu, Lu Zhang, Yamin Hu
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 BugBuilder,通过剥离重构改动、枚举子集并用测试验证,从版本库提交中自动提取完整且简洁的缺陷修复补丁。

高质量的缺陷与修复补丁数据集对软件测试、缺陷定位与程序修复研究至关重要。现有 Defects4J 等数据集规模偏小,因为构建依赖昂贵的人工介入;而版本控制系统中虽可自动获取修复提交与测试用例,但这些提交常混杂与缺陷无关的改动,导致无法自动提取简洁的修复补丁。本文提出自动化方法 BugBuilder:首先检测修复提交中涉及的重构,将其重新应用到缺陷版本上从而排除重构改动;随后枚举剩余改动的所有子集,并在测试用例上验证其是否构成完整的修复补丁;若没有任何子集可行,则将剩余部分整体视为完整而简洁的修复补丁。在 Defects4J 的 809 个真实修复提交上的评估表明,BugBuilder 为约 40% 的提交成功生成了完整简洁的修复补丁,且精确率达 99%,甚至高于人类专家。

问题
构建带简洁修复补丁的真实缺陷数据集代价高昂,而直接从版本控制系统的修复提交中提取补丁又会受到与缺陷无关改动(如重构)的干扰。
方法
BugBuilder 先检测修复提交中的重构并将其重新应用到缺陷版本以剔除重构改动,再枚举剩余改动的所有子集,用测试用例验证能否构成完整修复补丁,若无可行子集则以剩余部分整体作为补丁。
评估
在 Defects4J 的 809 个真实修复提交上进行评估,约 40% 的提交成功生成完整简洁的修复补丁,精确率为 99%,高于人类专家。
原文摘要(Abstract)

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

BibTeX
@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}
}