arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1906.03447cs.SE
收藏

机器生成的修补程序和机器提供的修补程序之间有什么不同?自动程序修复技术生成正确补丁的实证研究

How Different Is It Between Machine-Generated and Developer-Provided Patches? An Empirical Study on The Correct Patches Generated by Automated Program Repair Techniques

Shangwen Wang, Ming Wen, Liqian Chen, Xin Yi, Xiaoguang Mao

摘要:

背景资料:多年来,自动程序修复(Automated Program Repair,APR)由于能够降低修复错误的成本而受到学术界和工业界的广泛关注。然而,如何评估补丁的正确性仍然是一个开放的挑战。两种广泛采用的方法来应对这一挑战,包括手动检查和使用自动生成的测试进行验证,都是有偏见的(即,分别遭受主观性和低精度)。目的:为了解决这一问题,我们建议进行实证研究,了解正确的补丁,由现有的国家的最先进的APR技术,旨在为未来的补丁评估提供指导方针。方法:为此,我们首先提出了一个文献综述(LR)报告的正确补丁生成的最新技术的缺陷4J基准和收集177个正确的补丁后,健全检查的过程。我们研究了这些机器生成的正确补丁是如何实现语义等价的,但与开发人员提供的补丁相比在语法上存在差异,这些补丁如何在不同的项目和APR技术中分布,以及错误的特征如何影响为其生成的补丁。我们的主要发现包括:1)我们不需要像开发人员那样修复bug,因为我们观察到25.4%(45/177)2)机器生成的正确补丁的分布在Defects 4J项目和APR技术方面存在差异;以及3)APR技术倾向于生成与开发者针对具有大补丁大小的错误所生成的补丁不同的补丁。结论:我们的研究不仅验证了以前的研究结论,但也强调了未来的研究对评估补丁的正确性的影响。

英文摘要:

Background: Over the years, Automated Program Repair (APR) has attracted much attention from both academia and industry since it can reduce the costs in fixing bugs. However, how to assess the patch correctness remains to be an open challenge. Two widely adopted ways to approach this challenge, including manually checking and validating using automated generated tests, are biased (i.e., suffering from subjectivity and low precision respectively). Aim: To address this concern, we propose to conduct an empirical study towards understanding the correct patches that are generated by existing state-of-the-art APR techniques, aiming at providing guidelines for future assessment of patches. Method: To this end, we first present a Literature Review (LR) on the reported correct patches generated by recent techniques on the Defects4J benchmark and collect 177 correct patches after a process of sanity check. We investigate how these machine-generated correct patches achieve semantic equivalence, but syntactic difference compared with developer-provided ones, how these patches distribute in different projects and APR techniques, and how the characteristics of a bug affect the patches generated for it. Results: Our main findings include 1) we do not need to fix bugs exactly like how developers do since we observe that 25.4% (45/177) of the correct patches generated by APR techniques are syntactically different from developer-provided ones; 2) the distribution of machine-generated correct patches diverges for the aspects of Defects4J projects and APR techniques; and 3) APR techniques tend to generate patches that are different from those by developers for bugs with large patch sizes. Conclusion: Our study not only verifies the conclusions from previous studies but also highlights implications for future study towards assessing patch correctness.

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

↑