当前位置: X-MOL 学术arXiv.cs.SE › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A Syntax-Guided Edit Decoder for Neural Program Repair
arXiv - CS - Software Engineering Pub Date : 2021-06-15 , DOI: arxiv-2106.08253
Qihao Zhu, Zeyu Sun, Yuan-an Xiao, Wenjie Zhang, Kang Yuan, Yingfei Xiong, Lu Zhang

Automated Program Repair (APR) helps improve the efficiency of software development and maintenance. Recent APR techniques use deep learning, particularly the encoder-decoder architecture, to generate patches. Though existing DL-based APR approaches have proposed different encoder architectures, the decoder remains to be the standard one, which generates a sequence of tokens one by one to replace the faulty statement. This decoder has multiple limitations: 1) allowing to generate syntactically incorrect programs, 2) inefficiently representing small edits, and 3) not being able to generate project-specific identifiers. In this paper, we propose Recoder, a syntax-guided edit decoder with placeholder generation. Recoder is novel in multiple aspects: 1) Recoder generates edits rather than modified code, allowing efficient representation of small edits; 2) Recoder is syntax-guided, with the novel provider/decider architecture to ensure the syntactic correctness of the patched program and accurate generation; 3) Recoder generates placeholders that could be instantiated as project-specific identifiers later. We conduct experiments to evaluate Recoder on 395 bugs from Defects4J v1.2, 420 additional bugs from Defects4J v2.0, 297 bugs from IntroClassJava and 40 bugs from QuixBugs. Our results show that Recoder repairs 53 bugs on Defects4J v1.2, which achieves 26.2% (11 bugs) improvement over the previous state-of-the-art approach for single-hunk bugs (TBar). Importantly, to our knowledge, Recoder is the first DL-based APR approach that has outperformed the traditional APR approaches on this benchmark.

中文翻译:

用于神经程序修复的语法引导编辑解码器

自动程序修复 (APR) 有助于提高软件开发和维护的效率。最近的 APR 技术使用深度学习,尤其是编码器-解码器架构来生成补丁。尽管现有的基于 DL 的 APR 方法提出了不同的编码器架构,但解码器仍然是标准的,它会一个接一个地生成一系列标记来替换错误的语句。该解码器有多个限制:1) 允许生成语法错误的程序,2) 表示小编辑的效率低下,以及 3) 无法生成项目特定的标识符。在本文中,我们提出了 Recoder,这是一种具有占位符生成功能的语法引导编辑解码器。Recoder 在多个方面是新颖的: 1) Recoder 生成编辑而不是修改后的代码,允许有效地表示小编辑;2) Recoder是语法引导的,采用新颖的provider/decider架构,保证打补丁程序的句法正确和准确生成;3) Recoder 生成占位符,稍后可以将其实例化为项目特定的标识符。我们进行了实验以评估 Recoder 对 Defects4J v1.2 的 395 个错误、Defects4J v2.0 的 420 个额外错误、IntroClassJava 的 297 个错误和 QuixBugs 的 40 个错误。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。采用新颖的provider/decider架构,保证打补丁程序的句法正确性和准确生成;3) Recoder 生成占位符,稍后可以将其实例化为项目特定的标识符。我们进行了实验以评估 Recoder 对 Defects4J v1.2 的 395 个错误、Defects4J v2.0 的 420 个额外错误、IntroClassJava 的 297 个错误和 QuixBugs 的 40 个错误。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。采用新颖的provider/decider架构,保证打补丁程序的句法正确性和准确生成;3) Recoder 生成占位符,稍后可以将其实例化为项目特定的标识符。我们进行了实验以评估 Recoder 对 Defects4J v1.2 的 395 个错误、Defects4J v2.0 的 420 个额外错误、IntroClassJava 的 297 个错误和 QuixBugs 的 40 个错误。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。3) Recoder 生成占位符,稍后可以将其实例化为项目特定的标识符。我们进行了实验以评估 Recoder 对 Defects4J v1.2 的 395 个错误、Defects4J v2.0 的 420 个额外错误、IntroClassJava 的 297 个错误和 QuixBugs 的 40 个错误。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。3) Recoder 生成占位符,稍后可以将其实例化为项目特定的标识符。我们进行了实验以评估 Recoder 对 Defects4J v1.2 的 395 个错误、Defects4J v2.0 的 420 个额外错误、IntroClassJava 的 297 个错误和 QuixBugs 的 40 个错误。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。我们的结果表明,Recoder 在 Defects4J v1.2 上修复了 53 个错误,与之前针对单块错误 (TBar) 的最先进方法相比,实现了 26.2%(11 个错误)的改进。重要的是,据我们所知,Recoder 是第一个基于深度学习的 APR 方法,它在该基准测试中的表现优于传统的 APR 方法。
更新日期:2021-06-17
down
wechat
bug