一句话:提出规则化变更分解与 AST 差分,使 Delta 调试能自动提取更小补丁。
Delta 调试(DD)通过系统化测试最小化正常版本与故障版本间的变更来定位回归原因,但当变更集很大且没有配置管理系统时,避免产生不可测试的无效子集仍很困难。本文提出基于规则的语法与语义分解方法,将源代码变更拆为相互独立的组件,以支持 DD 并自动提取补丁;与纯文本差分不同,方法在抽象语法树(AST)上进行树差分。作者为 Java 实现原型,并在 Defects4J 的 194 个缺陷修复和 6 个开源 Java 项目的 8 个真实回归缺陷上评估。相比基于纯文本差分的 DD 工具,平均而言,前者提取的补丁大小减少 50%,测试执行增加 5%;后者补丁大小减少 73%,测试执行增加 40%。
Delta debugging (DD) is an approach to automating the debugging activities based on systematic testing. DD algorithms find the cause of a regression of a program by minimizing the changes applied between a working version and a faulty version of the program. However, it is still an open problem to minimize a huge set of changes while avoiding any invalid subsets that do not result in testable programs, especially in case that no software configuration management system is available. In this paper, we propose a rule-based approach to syntactic and semantic decomposition of changes into independent components to facilitate DD on source code changes, and hence to extract patches automatically. For analyzing changes, we make use of tree differencing on abstract syntax trees instead of common differencing on plain texts. We have developed an experimental implementation for Java programs and applied it to 194 bug fixes from Defects4J and 8 real-life regression bugs from 6 open source Java projects. Compared to a DD tool based on plain text differencing, it extracted patches whose size is reduced by 50% at the cost of 5% more test executions for the former dataset and by 73% at the cost of 40% more test executions for the latter, both on average.
DOI 原文 ·
@inproceedings{paperbot4590,
title = {Automated patch extraction via syntax- and semantics-aware Delta debugging on source code changes},
author = {Masatomo Hashimoto and Akira Mori and Tomonori Izumida},
booktitle = {FSE},
year = {2018},
doi = {10.1145/3236024.3236047}
}