Skip to main content
QUICK REVIEW

[Paper Review] ENCORE: Ensemble Learning using Convolution Neural Machine Translation for Automatic Program Repair

Thibaud Lutellier, Lawrence Pang|arXiv (Cornell University)|Jun 20, 2019
Software Testing and Debugging TechniquesComputer Science69 references10 citations
TL;DR

ENCORE proposes an ensemble convolutional neural machine translation (NMT) approach for automatic program repair that outperforms prior methods by leveraging multiple diverse NMT models to fix bugs across multiple programming languages. It achieves state-of-the-art results, repairing 67 bugs in total—including 16 previously unfixed ones—on five benchmarks in Java, C++, Python, and JavaScript.

ABSTRACT

Automated generate-and-validate (G&V) program repair techniques typically rely on hard-coded rules, only fix bugs following specific patterns, and are hard to adapt to different programming languages. We propose ENCORE, a new G&V technique, which uses ensemble learning on convolutional neural machine translation (NMT) models to automatically fix bugs in multiple programming languages. We take advantage of the randomness in hyper-parameter tuning to build multiple models that fix different bugs and combine them using ensemble learning. This new convolutional NMT approach outperforms the standard long short-term memory (LSTM) approach used in previous work, as it better captures both local and long-distance connections between tokens. Our evaluation on two popular benchmarks, Defects4J and QuixBugs, shows that ENCORE fixed 42 bugs, including 16 that have not been fixed by existing techniques. In addition, ENCORE is the first G&V repair technique to be applied to four popular programming languages (Java, C++, Python, and JavaScript), fixing a total of 67 bugs across five benchmarks.

Motivation & Objective

  • Address the limitations of existing automated program repair (APR) techniques that rely on hard-coded rules and struggle with generalization across programming languages.
  • Overcome the poor generalization and limited search space of prior neural machine translation (NMT)-based APR approaches, which often fail to fix complex or non-pattern-based bugs.
  • Enable effective program repair across multiple programming languages by learning repair patterns directly from data, reducing dependency on language-specific rules.
  • Improve repair effectiveness by using ensemble learning on convolutional NMT models with varied hyperparameters to capture diverse repair strategies.
  • Reduce reliance on bug context by training on short, fixed-length buggy-to-fixed line pairs, enabling scalability and better performance on larger methods.

Proposed method

  • Train multiple convolutional NMT models with different hyperparameters via random search to create model diversity, enhancing the ability to capture varied repair patterns.
  • Use ensemble learning to combine predictions from multiple NMT models, improving robustness and generalization across diverse bug types.
  • Apply a convolutional encoder-decoder architecture instead of LSTM-based models to better capture both local and long-range dependencies in code tokens.
  • Train models on up to millions of buggy-fixed line pairs, focusing on fixed-length input sequences to avoid context length issues and improve training efficiency.
  • Validate generated patches using the program’s test suite, returning the highest-ranked fix that compiles and passes all fault-revealing test cases.
  • Leverage multi-step attention mechanisms to explain model predictions and improve interpretability for developers and model developers.

Experimental results

Research questions

  • RQ1Can an ensemble of convolutional NMT models outperform standard LSTM-based NMT and rule-based G&V techniques in automatic program repair?
  • RQ2To what extent can a data-driven, neural NMT approach generalize across multiple programming languages without language-specific rule engineering?
  • RQ3Does removing explicit bug context from input sequences improve model performance and scalability, especially for larger methods?
  • RQ4Can ensemble learning on diverse NMT models fix previously unfixed bugs that existing techniques miss?
  • RQ5How effective is the proposed approach in handling complex bugs beyond simple syntax or compilation errors?

Key findings

  • ENCORE fixed 67 bugs across five benchmarks in four programming languages (Java, C++, Python, JavaScript), significantly outperforming prior NMT-based and rule-based G&V techniques.
  • ENCORE successfully repaired 16 bugs that had not been fixed by any existing technique, demonstrating its ability to discover novel repair patterns.
  • The convolutional NMT architecture outperformed standard LSTM-based models by better capturing local and long-distance token dependencies in code.
  • By training on millions of fixed-length buggy-to-fixed line pairs and avoiding explicit context, ENCORE achieved better scalability and performance than context-heavy approaches.
  • ENCORE’s ensemble learning approach reduced sensitivity to hyperparameter randomness and improved robustness across diverse bug types.
  • The model generated an overfitted patch that revealed a potential library-level bug in java.util.Arrays.asList, indicating potential for mutant generation and deeper bug detection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.