Automated program repair (APR) has achieved promising results, especially using neural networks. Yet, the overwhelming majority of patches produced by APR tools are confined to one single location. When looking at the patches produced with neural repair, most of them fail to compile, while a few uncompilable ones go in the right direction. In both cases, the fundamental problem is to ignore the potential of partial patches. In this paper, we propose an iterative program repair paradigm called ITER founded on the concept of improving partial patches until they become plausible and correct. First, ITER iteratively improves partial single-location patches by fixing compilation errors and further refining the previously generated code. Second, ITER iteratively improves partial patches to construct multi-location patches, with fault localization re-execution. ITER is implemented for Java based on battle-proven deep neural networks and code representation. ITER is evaluated on 476 bugs from 10 open-source projects in Defects4J 2.0. ITER succeeds in repairing 76 of them, including 15 multi-location bugs which is a new frontier in the field.
翻译:摘要:自动化程序修复(APR)已取得显著成果,尤其是借助神经网络技术。然而,APR工具生成的绝大多数补丁仅局限于单个位置。在分析神经修复生成的补丁时,多数无法通过编译,少数虽未通过编译但已向正确方向迈出步伐。这两种情况的根本问题在于忽视了部分补丁的潜在价值。本文提出一种名为ITER的迭代式程序修复范式,其核心理念在于持续优化部分补丁直至其变得合理且正确。首先,ITER通过修复编译错误并进一步优化先前生成的代码,迭代改进单位置部分补丁。其次,ITER通过故障定位重新执行,迭代改进部分补丁以构建多位置补丁。ITER基于经过实战验证的深度神经网络与代码表示技术,在Java语言上实现。我们在Defects4J 2.0中10个开源项目的476个缺陷上评估了ITER,成功修复其中76个缺陷,包括15个多位置缺陷——这标志着该领域的新突破。