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

用于自动生成补丁评估的基于测试的补丁聚类

Test-based Patch Clustering for Automatically-Generated Patches Assessment

Matias Martinez, Maria Kechagia, Anjana Perera, Justyna Petke, Federica Sarro, Aldeida Aleti

AI总结:

本文提出轻量级基于测试的补丁聚类方法xTestCluster,通过新生成测试用例的执行行为对多APR工具生成的补丁进行聚类,使开发者仅需分析每个聚类的样本,中位数减少50%的补丁审查量,显著降低验证成本并揭示补丁行为差异。

摘要:

先前的研究表明,自动程序修复(APR)技术存在过拟合问题。当运行一个补丁且测试套件未揭示任何错误,但该补丁实际上并未修复底层错误,或者它引入了测试套件未覆盖的新缺陷时,就会发生过拟合。因此,APR工具生成的补丁需要由人类程序员进行验证,这可能非常昂贵,并阻碍了APR工具在实践中的采用。我们的工作旨在最小化程序员必须审查的合理补丁数量,从而减少找到正确补丁所需的时间。我们引入了一种新颖的轻量级基于测试的补丁聚类方法,称为xTestCluster,它根据补丁的动态行为对其进行聚类。xTestCluster在补丁生成阶段之后应用,以分析来自一个或多个修复工具生成的补丁,并提供有关这些补丁的更多信息以促进补丁评估。xTestCluster的新颖之处在于使用新生成的测试用例执行信息,来聚类由多种APR方法生成的补丁。一个聚类由在相同生成测试用例上失败的补丁组成。xTestCluster的输出为开发者提供了:a)一种减少待分析补丁数量的方法,因为他们可以专注于分析每个聚类中的补丁样本;b)附加在每个补丁上的额外信息。在分析了来自21个Java APR工具的902个合理补丁后,我们的结果表明,xTestCluster能够将需要审查和分析的补丁数量中位数减少50%。xTestCluster可以为必须审查APR工具生成的大量补丁的开发者节省大量时间,并为他们提供新的测试用例,以揭示生成补丁之间行为的差异。

英文摘要:

Previous studies have shown that Automated Program Repair (APR) techniques suffer from the overfitting problem. Overfitting happens when a patch is run and the test suite does not reveal any error, but the patch actually does not fix the underlying bug or it introduces a new defect that is not covered by the test suite. Therefore, the patches generated by apr tools need to be validated by human programmers, which can be very costly, and prevents apr tool adoption in practice. Our work aims to minimize the number of plausible patches that programmers have to review, thereby reducing the time required to find a correct patch. We introduce a novel light-weight test-based patch clustering approach called xTestCluster, which clusters patches based on their dynamic behavior. xTestCluster is applied after the patch generation phase in order to analyze the generated patches from one or more repair tools and to provide more information about those patches for facilitating patch assessment. The novelty of xTestCluster lies in using information from execution of newly generated test cases to cluster patches generated by multiple APR approaches. A cluster is formed of patches that fail on the same generated test cases. The output from xTestCluster gives developers a) a way of reducing the number of patches to analyze, as they can focus on analyzing a sample of patches from each cluster, b) additional information attached to each patch. After analyzing 902 plausible patches from 21 Java APR tools, our results show that xTestCluster is able to reduce the number of patches to review and analyze with a median of 50%. xTestCluster can save a significant amount of time for developers that have to review the multitude of patches generated by apr tools, and provides them with new test cases that expose the differences in behavior between generated patches.

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

↑