CLLGSEApr 25, 2020

Learning to Update Natural Language Comments Based on Code Changes

arXiv:2004.12169v21017 citationsHas Code
AI Analysis

This addresses the challenge of maintaining documentation accuracy in software development, though it is an incremental step in automated code-comment synchronization.

The paper tackles the problem of automatically updating natural language comments when source code changes, proposing a model that learns to correlate changes across code and comment representations to generate appropriate comment edits. Results show the model outperforms baselines on making edits, as evaluated with automatic metrics and human assessment.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes