Neural machine translation (NMT) architectures have achieved promising results for automatic program repair. Yet, they have the limitation of generating low-quality patches (e.g., not compilable patches). This is because the existing works only optimize a purely syntactic loss function based on characters and tokens without incorporating program-specific information during neural network weight optimization. In this paper, we propose a novel program repair model called RewardRepair. The core novelty of RewardRepair is to improve NMT-based program repair with a loss function based on program compilation and test execution information, rewarding the network to produce patches that compile and that do not overfit. We conduct several experiments to evaluate RewardRepair showing that it is feasible and effective to use compilation and test execution results to optimize the underlying neural repair model. RewardRepair correctly repairs 207 bugs over four benchmarks. we report on repair success for 121 bugs that are fixed for the first time in the literature. Also, RewardRepair produces up to 45.3% of compilable patches, an improvement over the 39% by the state-of-the-art.
翻译:神经机翻译( NMT) 结构在自动程序修理方面取得了令人乐观的成果。 然而,它们具有生成低质量补丁( 例如, 无法调译补丁) 的限制。 这是因为现有工程只优化基于字符和符号的纯合成损失功能, 而没有在神经网络重量优化过程中纳入特定程序的信息。 在本文中, 我们提议了一个名为 RewardRepair 的新颖程序修理模型。 RewardRepair 的核心新颖之处是改进基于 NMT 的程式修理, 其损失功能基于程序汇编和测试执行信息, 奖励网络生成编译和不过分的补丁。 我们进行了几次实验, 以评价RewardRepair 显示, 使用编译和测试执行结果来优化基本神经修复模型是可行和有效的。 RewardRepair 正确修复了 207 个基于四个基准的错误。 我们报告在文献中第一次固定的121个错误的成功情况。 另外, RewardRepair 生成了高达45. 3 % 的可调和的补丁, 由州改进了39 % 。