Where should i comment my code? A dataset and model for predicting locations that need comments

3Citations
Citations of this article
30Readers
Mendeley users who have this article in their library.
Get full text

Abstract

Programmers should write code comments, but not on every line of code. We have created a machine learning model that suggests locations where a programmer should write a code comment. We trained it on existing commented code to learn locations that are chosen by developers. Once trained, the model can predict locations in new code. Our models achieved precision of 74% and recall of 13% in identifying comment-worthy locations. This first success opens the door to future work, both in the new where-To-comment problem and in guiding comment generation. Our code and data is available at http://groups.inf.ed.ac.uk/cup/comment-locator/. CCS CONCEPTS • Software and its engineering \rightarrow Maintaining software; • Computing methodologies \rightarrow Neural networks; Natural language processing.

Cite

CITATION STYLE

APA

Louis, A., Dash, S. K., Barr, E. T., Ernst, M. D., & Sutton, C. (2020). Where should i comment my code? A dataset and model for predicting locations that need comments. In Proceedings - 2020 ACM/IEEE 42nd International Conference on Software Engineering: New Ideas and Emerging Results, ICSE-NIER 2020 (pp. 21–24). Institute of Electrical and Electronics Engineers Inc. https://doi.org/10.1145/3377816.3381736

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