UCL Discovery
UCL home » Library Services » Electronic resources » UCL Discovery

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

Louis, A; Dash, SK; Barr, ET; Ernst, MD; Sutton, C; (2020) Where should I comment my code? A dataset and model for predicting locations that need comments. In: ICSE-NIER '20: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering: New Ideas and Emerging Results. (pp. pp. 21-24). Association for Computing Machinery (ACM) Green open access

[thumbnail of main.pdf]
Preview
Text
main.pdf - Accepted Version

Download (437kB) | Preview

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/.

Type: Proceedings paper
Title: Where should I comment my code? A dataset and model for predicting locations that need comments
Event: The 42nd International Conference on Software Engineering, New Ideas and Emerging Results Track
Location: Seoul, Korea
Dates: 23 May 2020 - 29 May 2020
Open access status: An open access version is available from UCL Discovery
DOI: 10.1145/3377816.3381736
Publisher version: https://doi.org/10.1145/3377816.3381736
Language: English
Additional information: This version is the author accepted manuscript. For information on re-use, please refer to the publisher's terms and conditions.
UCL classification: UCL
UCL > Provost and Vice Provost Offices > UCL BEAMS
UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science
UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Computer Science
URI: https://discovery.ucl.ac.uk/id/eprint/10107433
Downloads since deposit
35Downloads
Download activity - last month
Download activity - last 12 months
Downloads by country - last 12 months

Archive Staff Only

View Item View Item