Where should I comment my code?
Where should I comment my code?
复制标题
我应该在哪里注释我的代码?
DOI:
10.1145/3377816.3381736
复制
发表时间:
2020
期刊:
影响因子:
--
通讯作者:
Louis A
中科院分区:
文献类型:
--
作者:
Louis A
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 newwhere-to-commentproblem and in guiding comment generation. Our code and data is available at http://groups.inf.ed.ac.uk/cup/comment-locator/.