CoCoNuT: Combining Context-Aware Neural Translation Models using Ensemble for Program Repair
Automated generate-and-validate (G&V) program repair techniques (APR) typically rely on hard-coded rules, thus only fixing bugs following specific fix patterns. These rules require a significant amount of manual effort to discover and are hard to adapt to different programming languages. To address these challenges, we propose CoCoNuT, a new G&V technique, which uses ensemble learning on a new context-aware neural machine translation (NMT) architecture to automatically fix bugs in multiple programming languages. To better represent the context of a bug, we introduce a new context-aware NMT architecture that represents the buggy source code and its surrounding context separately. CoCoNuT also takes advantage of the randomness in hyper-parameter tuning to build multiple models that fix different bugs and combine these models using ensemble learning. Our evaluation on six popular benchmarks for four programming languages shows that CoCoNuT fixes 499 bugs, including 329 bugs that were fixed by none of the 25 techniques we compared with.