We present the first systematic analysis of the characteristics of patch search spaces for automatic patch generation systems. We analyze the search spaces of two current state-of-the-art systems, SPR and Prophet, with 16 different search space configurations. Our results are derived from an analysis of 1104 different search spaces and 768 patch generation executions. Together these experiments consumed over 9000 hours of CPU time on Amazon EC2.
The analysis shows that 1) correct patches are sparse in the search spaces (typically at most one correct patch per search space per defect), 2) incorrect patches that nevertheless pass all of the test cases in the validation test suite are typically orders of magnitude more abundant, and 3) leveraging information other than the test suite is therefore critical for enabling the system to successfully isolate correct patches.
We also characterize a key tradeoff in the structure of the search spaces. Larger and richer search spaces that contain correct patches for more defects can actually cause systems to find fewer, not more, correct patches. We identify two reasons for this phenomenon: 1) increased validation times because of the presence of more candidate patches and 2) more incorrect patches that pass the test suite and block the discovery of correct patches. These fundamental properties, which are all characterized for the first time in this paper, help explain why past systems often fail to generate correct patches and help identify challenges, opportunities, and productive future directions for the field.
Attention: Not Just Another Dataset for Patch-Correctness Checking
自动程序修复(Automated Program Repair,APR)技术已引起学术界和工业界的广泛关注。同时,当前最先进的APR工具的一个主要限制是,通过所有原始测试的补丁不一定是开发人员想要的正确补丁,即,合理的补丁问题。迄今为止,已经提出了各种补丁正确性检查(PCC)技术来解决这个重要问题。然而,它们仅在非常有限的数据集上进行评估,因为用于生成此类补丁的APR工具只能探索可能补丁的搜索空间的一小部分,对现有PCC研究的外部有效性构成严重威胁。在本文中,我们构建了一个广泛的PCC数据集(据我们所知最大的手动标记的PCC数据集),以重新审视所有最先进的PCC技术。更具体地说,我们的PCC数据集包括从最近的PraPR APR工具生成的1,988个补丁,该工具利用高度优化的字节码级别补丁执行,并可以在其大型预定义的搜索空间内彻底探索所有可能的合理补丁(包括众所周知的修复模式)来自各种以前的APR工具)。我们对新数据集上代表性PCC技术的广泛研究揭示了各种令人惊讶的发现,并为未来的PCC研究提供了指导。
An Empirical Analysis of the Influence of Fault Space on Search-Based Automated Program Repair
自动程序修复(Automated program repair,APR)已经引起了广泛的研究关注,并且已经提出了各种技术。基于搜索的APR是这些技术中最重要的类别之一。现有的研究集中在设计有效的变异算子和搜索算法,以更好地找到正确的补丁。尽管有各种努力,这些技术的有效性仍然受到搜索空间爆炸问题的限制。这个问题的关键因素之一是现有研究报告的故障空间的质量。这促使我们研究故障空间的重要性,成功地找到一个正确的补丁。我们的实证研究旨在回答三个问题。故障空间是否与基于搜索的APR的性能显著相关?如果是,在应用昂贵的APR技术之前,是否有任何指示性测量来近似故障空间的准确性?有没有自动化的方法可以提高故障空间的精度?我们观察到,故障空间的准确性影响基于搜索的APR技术的有效性和效率,例如,即使正确的补丁在搜索空间中,当实际定位位置的等级低于10时,GenProg的失败率也可能高达$60\%$。此外,GenProg能够找到更多的正确补丁,并与更少的尝试时,给定的故障空间具有更高的精度。我们还发现,负突变覆盖率,这是在这项研究中被设计来衡量一个测试套件的能力,杀死突变的语句执行失败的测试,是最具指示性的测量,以估计基于搜索的APR的效率。最后,我们证实,自动生成的测试用例可以帮助提高故障空间的准确性,并进一步提高基于搜索的APR技术的性能。