Write a Blog >>
ICSE 2020
Mon 6 July - Sun 11 October 2020

Programmers should write code comments, but not on every line of code. Because both too few and too many comments are undesirable, programmers must judiciously decide where to write code comments. 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 \emph{where-to-comment} problem and in generating the content of comments.