An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translation

By Michele Tufano, Cody Watson, Gabriele Bavota, Massimiliano Di Penta, Martin White, Denys Poshyvanyk. 2018

450 citations recorded by the source corpus.

Millions of open source projects with numerous bug fixes are available in code repositories. This proliferation of software development histories can be leveraged to learn how to fix common programming bugs. To explore such a potential, we perform an empirical study to assess the feasibility of using Neural Machine Translation techniques for learning bug-fixing patches for real defects. First, we mine millions of bug-fixes from the change histories of projects hosted on GitHub in order to extract meaningful examples of such bug-fixes. Next, we abstract the buggy and corresponding fixed code, and use them to train an Encoder-Decoder model able to translate buggy code into its fixed version. In our empirical investigation, we found that such a model is able to fix thousands of unique buggy methods in the wild. Overall, this model is capable of predicting fixed patches generated by developers in 9--50% of the cases, depending on the number of candidate patches we allow it to generate. Also, the model is able to emulate a variety of different Abstract Syntax Tree operations and generate candidate patches in a split second.

Subfields: Information Systems, Software, Natural Language Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Yanqiao Zhu
  2. Yichen Xu
  3. Neel Sundaresan
  4. Baptiste Rozière
  5. Alexey Svyatkovskiy
  6. Yue Wang
  7. Steven C. H. Hoi
  8. Michele Tufano

In Software

  1. Neel Sundaresan
  2. Alexey Svyatkovskiy
  3. Yue Wang
  4. Steven C. H. Hoi
  5. Yanqiao Zhu
  6. Yichen Xu
  7. Michele Tufano
  8. Mark Harman

In Natural Language Processing

  1. Graham Neubig
  2. Mohit Bansal
  3. M. Zhou
  4. Guillaume Lample
  5. Nan Duan
  6. Baptiste Rozière
  7. Kyunghyun Cho
  8. Jianfeng Gao

Citations in the corpus