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

GLAD:修复遗漏错误的神经谓词合成

GLAD: Neural Predicate Synthesis to Repair Omission Faults

Sungmin Kang, Shin Yoo

摘要:

现有的模板和基于学习的APR工具已经成功地为许多基准测试故障找到了补丁。然而,我们对现有结果的分析表明,遗漏故障对这些技术构成了重大挑战。对于基于模板的方法,遗漏错误不提供应用模板的位置;对于将修复公式化为神经机器翻译(NMT)的基于学习的方法,遗漏错误类似地不提供要翻译的错误代码。为了解决这些问题,我们提出了GLAD,一种新的基于学习的修复技术,专门针对if子句合成。GLAD不需要错误行,因为它基于生成语言模型(LM)而不是机器翻译;因此,它可以修复遗漏错误。GLAD使用基于类型的语法智能地约束语言模型。此外,它有效地降低了验证成本,通过执行动态排名的候选补丁使用调试器。由于从翻译到合成的转变,GLAD与现有技术高度正交:GLAD可以正确修复以前基于NMT的技术无法修复的16个Defects 4J v1.2故障,同时保持合理的运行时成本,强调其作为APR工具的实用性和在实践中补充现有工具的潜力。对GLAD修复的错误的检查表明,GLAD可以快速生成表达式,这对其他技术来说是一个挑战。

英文摘要:

Existing template and learning-based APR tools have successfully found patches for many benchmark faults. However, our analysis of existing results shows that omission faults pose a significant challenge to these techniques. For template based approaches, omission faults provide no location to apply templates to; for learning based approaches that formulate repair as Neural Machine Translation (NMT), omission faults similarly do not provide the faulty code to translate. To address these issues, we propose GLAD, a novel learning-based repair technique that specifically targets if-clause synthesis. GLAD does not require a faulty line as it is based on generative Language Models (LMs) instead of machine translation; consequently, it can repair omission faults. GLAD intelligently constrains the language model using a type-based grammar. Further, it efficiently reduces the validation cost by performing dynamic ranking of candidate patches using a debugger. Thanks to the shift from translation to synthesis, GLAD is highly orthogonal to existing techniques: GLAD can correctly fix 16 Defects4J v1.2 faults that previous NMT-based techniques could not, while maintaining a reasonable runtime cost, underscoring its utility as an APR tool and potential to complement existing tools in practice. An inspection of the bugs that GLAD fixes reveals that GLAD can quickly generate expressions that would be challenging for other techniques.

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

↑