arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.00073cs.SEcs.AIcs.LG
收藏

CURE:代码感知神经机器翻译自动程序修复

CURE: Code-Aware Neural Machine Translation for Automatic Program Repair

Purdue University(普渡大学);University of Waterloo(滑铁卢大学)

Nan Jiang, Thibaud Lutellier, Lin Tan

摘要:

自动程序修复(APR)是提高软件可靠性的关键.最近,神经机器翻译(NMT)技术已被用于自动修复软件错误。虽然这些方法很有前途,但有两个主要的局限性。它们的搜索空间通常不包含正确的修复,并且它们的搜索策略忽略了软件知识,例如严格的代码语法。由于这些限制,现有的基于NMT的技术表现不如最好的基于模板的方法。我们提出了CURE,一种新的基于NMT的APR技术,具有三个主要的新颖性。首先,CURE在大型软件代码库上预训练程序设计语言(PL)模型,以便在APR任务之前学习类似于开发人员的源代码。其次,CURE设计了一个新的代码感知搜索策略,通过关注可编译的补丁和长度接近错误代码的补丁来找到更多正确的修复。最后,CURE使用子字标记化技术来生成包含更多正确修复的较小搜索空间。我们对两个广泛使用的基准测试的评估表明,CURE正确地修复了57个Defects4J错误和26个菜错误,在这两个基准测试上优于所有现有的APR技术。

英文摘要:

Automatic program repair (APR) is crucial to improve software reliability. Recently, neural machine translation (NMT) techniques have been used to fix software bugs automatically. While promising, these approaches have two major limitations. Their search space often does not contain the correct fix, and their search strategy ignores software knowledge such as strict code syntax. Due to these limitations, existing NMT-based techniques underperform the best template-based approaches. We propose CURE, a new NMT-based APR technique with three major novelties. First, CURE pre-trains a programming language (PL) model on a large software codebase to learn developer-like source code before the APR task. Second, CURE designs a new code-aware search strategy that finds more correct fixes by focusing on compilable patches and patches that are close in length to the buggy code. Finally, CURE uses a subword tokenization technique to generate a smaller search space that contains more correct fixes. Our evaluation on two widely-used benchmarks shows that CURE correctly fixes 57 Defects4J bugs and 26 QuixBugs bugs, outperforming all existing APR techniques on both benchmarks.

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

↑