Deep Just-In-Time Inconsistency Detection Between Comments and Source Code

By Sheena Panthaplackel, Junyi Jessy Li, Miloš Gligorić, Raymond J. Mooney. 2020

66 citations recorded by the source corpus.

Natural language comments convey key aspects of source code such as implementation, usage, and pre- and post-conditions. Failure to update comments accordingly when the corresponding code is modified introduces inconsistencies, which is known to lead to confusion and software bugs. In this paper, we aim to detect whether a comment becomes inconsistent as a result of changes to the corresponding body of code, in order to catch potential inconsistencies just-in-time, i.e., before they are committed to a code base. To achieve this, we develop a deep-learning approach that learns to correlate a comment with code changes. By evaluating on a large corpus of comment/code pairs spanning various comment types, we show that our model outperforms multiple baselines by significant margins. For extrinsic evaluation, we show the usefulness of our approach by combining it with a comment update model to build a more comprehensive automatic comment maintenance system which can both detect and resolve inconsistent comments based on code changes.

Subfields: Artificial Intelligence, Information Systems, Natural Language Processing, Program Analysis & Verification

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. Quoc V. Le
  2. Charles Sutton
  3. Luke S. Zettlemoyer
  4. Percy Liang
  5. Augustus Odena
  6. Graham Neubig
  7. Mohit Bansal
  8. Denny Zhou

In Information Systems

  1. Carrie J. Cai
  2. Augustus Odena
  3. Jacob Austin
  4. Maarten Bosma
  5. David Dohan
  6. Henryk Michalewski
  7. Maxwell Nye
  8. Quoc V. Le

In Natural Language Processing

  1. Charles Sutton
  2. Augustus Odena
  3. Quoc V. Le
  4. David Dohan
  5. Henryk Michalewski
  6. Maxwell Nye
  7. Maarten Bosma
  8. Jacob Austin

In Program Analysis & Verification

  1. Augustus Odena
  2. Charles Sutton
  3. Henryk Michalewski
  4. Maxwell Nye

Citations in the corpus