Automatically generating commit messages from diffs using neural machine translation

By Siyuan Jiang, Ameer Armaly, Collin McMillan. 2017

292 citations recorded by the source corpus.

Commit messages are a valuable resource in comprehension of software evolution, since they provide a record of changes such as feature additions and bug repairs. Unfortunately, programmers often neglect to write good commit messages. Different techniques have been proposed to help programmers by automatically writing these messages. These techniques are effective at describing what changed, but are often verbose and lack context for understanding the rationale behind a change. In contrast, humans write messages that are short and summarize the high level rationale. In this paper, we adapt Neural Machine Translation (NMT) to automatically "translate" diffs into commit messages. We trained an NMT algorithm using a corpus of diffs and human-written commit messages from the top 1k Github projects. We designed a filter to help ensure that we only trained the algorithm on higher-quality commit messages. Our evaluation uncovered a pattern in which the messages we generate tend to be either very high or very low quality. Therefore, we created a quality-assurance filter to detect cases in which we are unable to produce good messages, and return a warning instead.

Subfields: Artificial Intelligence, Information Systems, Software

How researchers see this paper

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

In Artificial Intelligence

  1. Ge Li
  2. Alexander LeClair
  3. Huan Sun
  4. Collin McMillan
  5. Ziyu Yao
  6. Hongyu Zhang
  7. Zhi Jin
  8. Jayavardhan Reddy Peddamail

In Information Systems

  1. Ge Li
  2. Hongyu Zhang
  3. Collin McMillan
  4. Alexander LeClair
  5. Michele Tufano
  6. Gabriele Bavota
  7. Huan Sun
  8. Ziyu Yao

In Software

  1. Gabriele Bavota
  2. Michele Tufano
  3. Hongyu Zhang
  4. Denys Poshyvanyk
  5. Ge Li
  6. Cody Watson
  7. Hailong Sun
  8. Xu Wang

Citations in the corpus