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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b9949c2a-2a06-412d-9cbd-0e274f5f6e6cCited 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
- Coeditor: Leveraging Repo-level Diffs for Code Auto-editingJiayi Wei, Greg Durrett, Isil DilligICLR 2024 · 5 citations
- COME: Commit Message Generation with Modification EmbeddingYichen He, Liran Wang, Kaiyi Wang, Yupeng Zhang et al.ISSTA 2023 · 14 citations
