Learning to update natural language comments based on code changes

45Citations
Citations of this article
139Readers
Mendeley users who have this article in their library.

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.

Cite

CITATION STYLE

APA

Panthaplackel, S., Nie, P., Gligoric, M., Li, J. J., & Mooney, R. J. (2020). Learning to update natural language comments based on code changes. In Proceedings of the Annual Meeting of the Association for Computational Linguistics (pp. 1853–1868). Association for Computational Linguistics (ACL). https://doi.org/10.18653/v1/2020.acl-main.168

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free