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

10/04/2020
by   Sheena Panthaplackel, et al.
0

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 version control system. 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/25/2020

Learning to Update Natural Language Comments Based on Code Changes

We formulate the novel task of automatically updating an existing natura...
research
06/10/2023

Bootstrapping Code-Text Pretrained Language Model to Detect Inconsistency Between Code and Comment

Comments on source code serve as critical documentation for enabling dev...
research
05/02/2022

HatCUP: Hybrid Analysis and Attention based Just-In-Time Comment Updating

When changing code, developers sometimes neglect updating the related co...
research
10/16/2018

An analysis of Principle 1.2 in the new ACM Code Of Ethics

The new ACM Code of Ethics is a much-needed update, but introduced chang...
research
06/12/2018

Deep Learning to Detect Redundant Method Comments

Comments in software are critical for maintenance and reuse. But apart f...
research
06/25/2020

Source Code Comments: Overlooked in the Realm of Code Clone Detection

Reusing code can produce duplicate or near-duplicate code clones in code...
research
02/14/2023

Developer-Intent Driven Code Comment Generation

Existing automatic code comment generators mainly focus on producing a g...

Please sign up or login with your details

Forgot password? Click here to reset