Deep Just-In-Time Inconsistency Detection Between Comments and Source Code
Sheena Panthaplackel, Junyi Jessy Li, Milos Gligoric, Raymond J. Mooney
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- CCRep: Learning Code Change Representations via Pre-Trained Code Model and Query Back 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CCRep: Learning Code Change Representations via Pre-Trained Code Model and Query Back 引用了 Learning to Update Natural Language Comments Based on Code Changes
- On the Evaluation of Neural Code Summarization 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- On the Evaluation of Neural Code Summarization 引用了 Learning to Update Natural Language Comments Based on Code Changes
- Learning to Update Natural Language Comments Based on Code Changes 引用了 Associating Natural Language Comment and Source Code Entities
- Impact of Evaluation Methodologies on Code Summarization 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Impact of Evaluation Methodologies on Code Summarization 引用了 Learning to Update Natural Language Comments Based on Code Changes
- CoditT5: Pretraining for Source Code and Natural Language Editing 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CoditT5: Pretraining for Source Code and Natural Language Editing 引用了 Learning to Update Natural Language Comments Based on Code Changes
- Learning Deep Semantics for Test Completion 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Learning Deep Semantics for Test Completion 引用了 Associating Natural Language Comment and Source Code Entities
- Learning Deep Semantics for Test Completion 引用了 Learning to Update Natural Language Comments Based on Code Changes
- Learning Deep Semantics for Test Completion 引用了 Impact of Evaluation Methodologies on Code Summarization
- Learning Deep Semantics for Test Completion 引用了 CoditT5: Pretraining for Source Code and Natural Language Editing
引用它的顶会 Paper13
- CoditT5: Pretraining for Source Code and Natural Language EditingJiyang Zhang, Sheena Panthaplackel, Pengyu Nie, Junyi Jessy Li 等ASE 2022 · 81 次引用
- On the Evaluation of Neural Code SummarizationEnsheng Shi, Yanlin Wang, Lun Du, Junjie Chen 等ICSE 2022 · 76 次引用
- Learning Deep Semantics for Test CompletionPengyu Nie, Rahul Banerjee, Junyi Jessy Li, Raymond J. Mooney 等ICSE 2023 · 45 次引用
- CCRep: Learning Code Change Representations via Pre-Trained Code Model and Query BackZhongxin Liu, Zhijie Tang, Xin Xia, Xiaohu YangICSE 2023 · 25 次引用
- Impact of Evaluation Methodologies on Code SummarizationPengyu Nie, Jiyang Zhang, Junyi Jessy Li, Raymond J. Mooney 等ACL 2022 · 21 次引用
它引用的 Paper3
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- Associating Natural Language Comment and Source Code EntitiesSheena Panthaplackel, Milos Gligoric, Raymond J. Mooney, Junyi Jessy LiAAAI 2020 · 21 次引用
- Learning to Update Natural Language Comments Based on Code ChangesSheena Panthaplackel, Pengyu Nie, Milos Gligoric, Junyi Jessy Li 等ACL 2020 · 1 次引用
相关 Paper
- Automating Just-In-Time Comment UpdatingZhongxin Liu, Xin Xia, Meng Yan, Shanping LiASE 2020 · 46 次引用
- Code Comment Inconsistency Detection and Rectification Using a Large Language ModelGuoping Rong, Yongda Yu, Song Liu, Xin Tan 等ICSE 2025 · 4 次引用
- CCT5: A Code-Change-Oriented Pre-trained ModelBo Lin, Shangwen Wang, Zhongxin Liu, Yepang Liu 等FSE 2023 · 69 次引用
- Towards Automating Code Review ActivitiesRosalia Tufano, Luca Pascarella, Michele Tufano, Denys Poshyvanyk 等ICSE 2021 · 4 次引用
- Automating the removal of obsolete TODO commentsZhipeng Gao, Xin Xia, David Lo, John C. Grundy 等FSE 2021 · 34 次引用
