Deep Just-In-Time Inconsistency Detection Between Comments and Source Code
Sheena Panthaplackel, Junyi Jessy Li, Milos Gligoric, Raymond J. Mooney
Abstract
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
13 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CCRep: Learning Code Change Representations via Pre-Trained Code Model and Query Back cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CCRep: Learning Code Change Representations via Pre-Trained Code Model and Query Back cites Learning to Update Natural Language Comments Based on Code Changes
- On the Evaluation of Neural Code Summarization cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- On the Evaluation of Neural Code Summarization cites Learning to Update Natural Language Comments Based on Code Changes
- Learning to Update Natural Language Comments Based on Code Changes cites Associating Natural Language Comment and Source Code Entities
- Impact of Evaluation Methodologies on Code Summarization cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Impact of Evaluation Methodologies on Code Summarization cites Learning to Update Natural Language Comments Based on Code Changes
- CoditT5: Pretraining for Source Code and Natural Language Editing cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CoditT5: Pretraining for Source Code and Natural Language Editing cites Learning to Update Natural Language Comments Based on Code Changes
- Learning Deep Semantics for Test Completion cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Learning Deep Semantics for Test Completion cites Associating Natural Language Comment and Source Code Entities
- Learning Deep Semantics for Test Completion cites Learning to Update Natural Language Comments Based on Code Changes
- Learning Deep Semantics for Test Completion cites Impact of Evaluation Methodologies on Code Summarization
- Learning Deep Semantics for Test Completion cites CoditT5: Pretraining for Source Code and Natural Language Editing
Cited by top-tier papers13
- CoditT5: Pretraining for Source Code and Natural Language EditingJiyang Zhang, Sheena Panthaplackel, Pengyu Nie, Junyi Jessy Li et al.ASE 2022 · 81 citations
- On the Evaluation of Neural Code SummarizationEnsheng Shi, Yanlin Wang, Lun Du, Junjie Chen et al.ICSE 2022 · 76 citations
- Learning Deep Semantics for Test CompletionPengyu Nie, Rahul Banerjee, Junyi Jessy Li, Raymond J. Mooney et al.ICSE 2023 · 45 citations
- CCRep: Learning Code Change Representations via Pre-Trained Code Model and Query BackZhongxin Liu, Zhijie Tang, Xin Xia, Xiaohu YangICSE 2023 · 25 citations
- Impact of Evaluation Methodologies on Code SummarizationPengyu Nie, Jiyang Zhang, Junyi Jessy Li, Raymond J. Mooney et al.ACL 2022 · 21 citations
Builds on3
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- Associating Natural Language Comment and Source Code EntitiesSheena Panthaplackel, Milos Gligoric, Raymond J. Mooney, Junyi Jessy LiAAAI 2020 · 21 citations
- Learning to Update Natural Language Comments Based on Code ChangesSheena Panthaplackel, Pengyu Nie, Milos Gligoric, Junyi Jessy Li et al.ACL 2020 · 1 citation
Related papers
- Automating Just-In-Time Comment UpdatingZhongxin Liu, Xin Xia, Meng Yan, Shanping LiASE 2020 · 46 citations
- Code Comment Inconsistency Detection and Rectification Using a Large Language ModelGuoping Rong, Yongda Yu, Song Liu, Xin Tan et al.ICSE 2025 · 4 citations
- CCT5: A Code-Change-Oriented Pre-trained ModelBo Lin, Shangwen Wang, Zhongxin Liu, Yepang Liu et al.FSE 2023 · 69 citations
- Towards Automating Code Review ActivitiesRosalia Tufano, Luca Pascarella, Michele Tufano, Denys Poshyvanyk et al.ICSE 2021 · 4 citations
- Automating the removal of obsolete TODO commentsZhipeng Gao, Xin Xia, David Lo, John C. Grundy et al.FSE 2021 · 34 citations
