SOSRepair: Expressive Semantic Search for Real-World Program Repair

SOSRepair: Expressive Semantic Search for Real-World Program Repair
复制标题

DOI:
10.1109/tse.2019.2944914
复制
发表时间:
2021-10
影响因子:
7.4
通讯作者:
Afsoon Afzal;Manish Motwani;Kathryn T. Stolee;Yuriy Brun;Claire Le Goues
Afsoon Afzal;Manish Motwani;Kathryn T. Stolee;Yuriy Brun;Claire Le Goues
中科院分区:
计算机科学1区
文献类型:
--
作者:
Afsoon Afzal;Manish Motwani;Kathryn T. Stolee;Yuriy Brun;Claire Le Goues

文献摘要

被引文献

相似文献

自动程序修复具有显著减少软件维护工作和成本的潜力。然而,最近的研究表明,它经常产生低质量的补丁,修复一些功能,但破坏其他功能。我们假设,通过用语义相似的代码片段替换可能有缺陷的代码区域来生成补丁,并且在比先前方法更高的粒度级别上这样做可以更好地捕获抽象和预期的规范,并可以提高修复质量。我们创建了SOSRepair,这是一种自动程序修复技术,它使用语义代码搜索用人类编写的行为相似(但不相同)的代码替换候选的有bug的代码区域。SOSRepair是第一个将这种技术扩展到实际系统中的实际缺陷。在此类缺陷的ManyBugs基准的一个子集上,SOSRepair为65个缺陷中的22个(34%)生成补丁,包括先前最先进的技术Angelix、Prophet和GenProg分别无法修复的3个、5个和6个缺陷。在这22个缺陷上,与之前的技术相比,SOSRepair产生了更多通过所有独立测试的补丁(9.41%)。我们展示了补丁粒度与生成通过所有独立测试的补丁的能力之间的关系。然后,我们表明故障定位精度是SOSRepair成功的关键因素。手动改进故障定位使SOSRepair修补了23个(35%)缺陷,其中16个(70%)通过了所有独立测试。我们得出结论:(1)更高粒度、基于语义的补丁可以提高补丁质量;(2)语义搜索有望产生高质量的现实世界缺陷修复;(3)故障定位研究可以显著提高程序修复技术的质量;(4)半自动化方法,开发人员建议修复位置可以产生高质量的补丁。
Automated program repair holds the potential to significantly reduce software maintenance effort and cost. However, recent studies have shown that it often produces low-quality patches that repair some but break other functionality. We hypothesize that producing patches by replacing likely faulty regions of code with semantically-similar code fragments, and doing so at a higher level of granularity than prior approaches can better capture abstraction and the intended specification, and can improve repair quality. We create SOSRepair, an automated program repair technique that uses semantic code search to replace candidate buggy code regions with behaviorally-similar (but not identical) code written by humans. SOSRepair is the first such technique to scale to real-world defects in real-world systems. On a subset of the ManyBugs benchmark of such defects, SOSRepair produces patches for 22 (34%) of the 65 defects, including 3, 5, and 6 defects for which previous state-of-the-art techniques Angelix, Prophet, and GenProg do not, respectively. On these 22 defects, SOSRepair produces more patches (9, 41%) that pass all independent tests than the prior techniques. We demonstrate a relationship between patch granularity and the ability to produce patches that pass all independent tests. We then show that fault localization precision is a key factor in SOSRepair's success. Manually improving fault localization allows SOSRepair to patch 23 (35%) defects, of which 16 (70%) pass all independent tests. We conclude that (1) higher-granularity, semantic-based patches can improve patch quality, (2) semantic search is promising for producing high-quality real-world defect repairs, (3) research in fault localization can significantly improve the quality of program repair techniques, and (4) semi-automated approaches in which developers suggest fix locations may produce high-quality patches.