Learning to Update Natural Language Comments Based on Code Changes
Sheena Panthaplackel, Pengyu Nie, Milos Gligoric, Junyi Jessy Li, Raymond J. Mooney
Abstract
We formulate the novel task of automatically updating an existing natural language comment based on changes in the body of code it accompanies. We propose an approach that learns to correlate changes across two distinct language representations, to generate a sequence of edits that are applied to the existing comment to reflect the source code modifications. We train and evaluate our model using a dataset that we collected from commit histories of open-source software projects, with each example consisting of a concurrent update to a method and its corresponding comment. We compare our approach against multiple baselines using both automatic metrics and human evaluation. Results reflect the challenge of this task and that our model outperforms baselines with respect to making edits.
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.
24 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
- On the Evaluation of Neural Code Summarization cites Deep Just-In-Time Inconsistency Detection Between Comments and Source Code
- Deep Just-In-Time Inconsistency Detection Between Comments and Source Code cites Associating Natural Language Comment and Source Code Entities
- CoditT5: Pretraining for Source Code and Natural Language Editing cites Deep Just-In-Time Inconsistency Detection Between Comments and Source Code
- Learning Deep Semantics for Test Completion cites Associating Natural Language Comment and Source Code Entities
- Learning Deep Semantics for Test Completion cites Deep Just-In-Time Inconsistency Detection Between Comments and Source Code
- Learning Deep Semantics for Test Completion cites CoditT5: Pretraining for Source Code and Natural Language Editing
Cited by top-tier papers24
- 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
- Deep Just-In-Time Inconsistency Detection Between Comments and Source CodeSheena Panthaplackel, Junyi Jessy Li, Milos Gligoric, Raymond J. MooneyAAAI 2021 · 62 citations
- Practitioners' Expectations on Automated Code Comment GenerationXing Hu, Xin Xia, David Lo, Zhiyuan Wan et al.ICSE 2022 · 50 citations
- Learning Deep Semantics for Test CompletionPengyu Nie, Rahul Banerjee, Junyi Jessy Li, Raymond J. Mooney et al.ICSE 2023 · 45 citations
Builds on3
- Automatic Fact-Guided Sentence ModificationDarsh J. Shah, Tal Schuster, Regina BarzilayAAAI 2020 · 44 citations
- CPC: automatically classifying and propagating natural language comments via program analysisJuan Zhai, Xiangzhe Xu, Yu Shi, Guanhong Tao et al.ICSE 2020 · 39 citations
- Associating Natural Language Comment and Source Code EntitiesSheena Panthaplackel, Milos Gligoric, Raymond J. Mooney, Junyi Jessy LiAAAI 2020 · 21 citations
Related papers
- Automating Just-In-Time Comment UpdatingZhongxin Liu, Xin Xia, Meng Yan, Shanping LiASE 2020 · 46 citations
- Multilingual Code Co-evolution using Large Language ModelsJiyang Zhang, Pengyu Nie, Junyi Jessy Li, Milos GligoricFSE 2023 · 34 citations
- Retrieve and Refine: Exemplar-based Neural Comment GenerationBolin Wei, Yongmin Li, Ge Li, Xin Xia et al.ASE 2020 · 68 citations
- Using Developer Discussions to Guide Fixing Bugs in SoftwareSheena Panthaplackel, Milos Gligoric, Junyi Jessy Li, Raymond J. MooneyEMNLP Findings 2022 · 4 citations
- COME: Commit Message Generation with Modification EmbeddingYichen He, Liran Wang, Kaiyi Wang, Yupeng Zhang et al.ISSTA 2023 · 14 citations
