Automated program repair is already deployed in industry, but concerns remain about repair quality. Recent research has shown that one of the main reasons repair tools produce incorrect (but seemingly correct) patches is imperfect fault localization (FL). This paper demonstrates that combining information from natural-language bug reports and test executions when localizing faults can have a significant positive impact on repair quality. For example, existing repair tools with such FL are able to correctly repair 7 defects in the Defects4J benchmark that no prior tools have repaired correctly. We develop, Blues, the first information-retrieval-based, statement-level FL technique that requires no training data. We further develop RAFL, the first unsupervised method for combining multiple FL techniques, which outperforms a supervised method. Using RAFL, we create SBIR by combining Blues with a spectrum-based (SBFL) technique. Evaluated on 815 real-world defects, SBIR consistently ranks buggy statements higher than its underlying techniques. We then modify three state-of-the-art repair tools, Arja, SequenceR, and SimFix, to use SBIR, SBFL, and Blues as their internal FL. We evaluate the quality of the produced patches on 689 real-world defects. Arja and SequenceR significantly benefit from SBIR: Arja using SBIR correctly repairs 28 defects, but only 21 using SBFL, and only 15 using Blues; SequenceR using SBIR correctly repairs 12 defects, but only 10 using SBFL, and only 4 using Blues. SimFix, (which has internal mechanisms to overcome poor FL), correctly repairs 30 defects using SBIR and SBFL, but only 13 using Blues. Our work is the first investigation of simultaneously using multiple software artifacts for automated program repair, and our promising findings suggest future research in this directions is likely to be fruitful.
翻译:自动程序修复已在工业界部署,但其修复质量仍存隐忧。最新研究表明,修复工具产生错误(但看似正确)补丁的主要原因之一在于缺陷定位不完善。本文证明,在定位缺陷时融合自然语言缺陷报告与测试执行信息,能够显著提升修复质量。例如,采用此类缺陷定位的现有修复工具能够在Defects4J基准测试中正确修复7个此前无工具可修复的缺陷。我们开发了Blues——首个无需训练数据、基于信息检索的语句级缺陷定位技术。进一步提出RAFL——首个无监督多缺陷定位技术融合方法,其性能超越有监督方法。通过将Blues与频谱缺陷定位技术(SBFL)结合,我们基于RAFL构建了SBIR。在815个真实缺陷上的评估表明,SBIR对错误语句的排序始终优于其底层技术。我们随后修改了Arja、SequenceR和SimFix三种最先进的修复工具,使其采用SBIR、SBFL和Blues作为内部缺陷定位模块。基于689个真实缺陷的补丁质量评估显示:Arja与SequenceR显著受益于SBIR——使用SBIR的Arja可正确修复28个缺陷(使用SBFL为21个,使用Blues为15个);使用SBIR的SequenceR正确修复12个缺陷(使用SBFL为10个,使用Blues为4个)。SimFix(其内部机制可克服缺陷定位不足)使用SBIR与SBFL正确修复30个缺陷,但使用Blues仅修复13个。本研究首次探索将多种软件制品同时用于自动程序修复,初步成果表明该方向后续研究具有广阔前景。