Table of Contents
Fetching ...

ITER: Iterative Neural Repair for Multi-Location Patches

He Ye, Martin Monperrus

TL;DR

ITER introduces an iterative neural program repair paradigm that refines partial patches toward correctness by interleaving compilation-error and functional-error repair within a single model. It combines iterative training (self-supervised data augmentation) and iterative inference (re-executed fault localization guided by partial patches) to repair both single- and multi-location bugs. On Defects4J v2.0, ITER fixes 74 bugs and plausibly patches 119, including 9 unique multi-location fixes, outperforming state-of-the-art baselines. The approach also demonstrates notable multi-location repair capabilities and provides insight into time-cost trade-offs, with a pipeline that can be applied to Java programs and potentially other languages. Public code and data are available to support reproducibility and further research.

Abstract

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 15.5% of them, including 9 uniquely repaired multi-location bugs.

ITER: Iterative Neural Repair for Multi-Location Patches

TL;DR

ITER introduces an iterative neural program repair paradigm that refines partial patches toward correctness by interleaving compilation-error and functional-error repair within a single model. It combines iterative training (self-supervised data augmentation) and iterative inference (re-executed fault localization guided by partial patches) to repair both single- and multi-location bugs. On Defects4J v2.0, ITER fixes 74 bugs and plausibly patches 119, including 9 unique multi-location fixes, outperforming state-of-the-art baselines. The approach also demonstrates notable multi-location repair capabilities and provides insight into time-cost trade-offs, with a pipeline that can be applied to Java programs and potentially other languages. Public code and data are available to support reproducibility and further research.

Abstract

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 15.5% of them, including 9 uniquely repaired multi-location bugs.
Paper Structure (23 sections, 1 equation, 7 figures, 7 tables, 2 algorithms)

This paper contains 23 sections, 1 equation, 7 figures, 7 tables, 2 algorithms.

Figures (7)

  • Figure 1: A patch for Chart-4 in Defects4J generated by AlphaRepair, Recoder, SelfAPR, RewardRepair, Cure, and CoCoNut. This compilation error patch could be further improved into a correct patch in a subsequent iteration.
  • Figure 2: Sketch of iterative repair: ITER chains compilation error repair and functional error repair with a single repair model.
  • Figure 3: Math-46: iterative execution of fault localization enables to focus on the next location to be repaired.
  • Figure 4: Overview of ITER: Iterative Training generates valuable training data in a self-supervised manner, Iterative Inference chains compilation error repair and functional error repair to improve partial patches until they become plausible.
  • Figure 5: ITER generates a correct patch for Time-4 based on improving a partial patch with a compiler error.
  • ...and 2 more figures