当前位置: X-MOL 学术J. Syst. Softw. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
RepliComment: Identifying clones in code comments
Journal of Systems and Software ( IF 3.7 ) Pub Date : 2021-09-07 , DOI: 10.1016/j.jss.2021.111069
Arianna Blasi 1 , Nataliia Stulova 2 , Alessandra Gorla 3 , Oscar Nierstrasz 2
Affiliation  

Code comments are the primary means to document implementation and facilitate program comprehension. Thus, their quality should be a primary concern to improve program maintenance. While much effort has been dedicated to detecting bad smells, such as clones in code, little work has focused on comments. In this paper we present our solution to detect clones in comments that developers should fix. RepliComment can automatically analyze Java projects and report instances of copy-and-paste errors in comments, and can point developers to which comments should be fixed. Moreover, it can report when clones are signs of poorly written comments. Developers should fix these instances too in order to improve the quality of the code documentation. Our evaluation of 10 well-known open source Java projects identified over 11K instances of comment clones, and over 1,300 of them are potentially critical. We improve on our own previous work Blasi and Gorla (2018), which could only find 36 issues in the same dataset. Our manual inspection of 412 issues reported by RepliComment reveals that it achieves a precision of 79% in reporting critical comment clones. The manual inspection of 200 additional comment clones that RepliComment filters out as being legitimate, could not evince any false negative.



中文翻译:

RepliComment:识别代码注释中的克隆

代码注释是记录实现和促进程序理解的主要手段。因此,它们的质量应该是改进程序维护的主要关注点。虽然很多工作都致力于检测不良气味,例如代码中的克隆,但很少有工作关注注释。在本文中,我们展示了我们的解决方案,用于检测开发人员应修复的评论中的克隆。RepliComment 可以自动分析 Java 项目并报告注释中复制和粘贴错误的实例,并且可以为开发人员指出应该修复哪些注释。此外,它可以报告克隆何时是写得不好的评论的迹象。开发人员也应该修复这些实例,以提高代码文档的质量。我们对 10 个知名开源 Java 项目的评估确定了超过 11,000 个评论克隆实例,其中 1,300 多个可能是关键的。我们改进了我们自己之前的工作 Blasi 和 Gorla (2018),它只能在同一数据集中找到 36 个问题。我们对 RepliComment 报告的 412 个问题的手动检查表明,它在报告关键评论克隆方面达到了 79% 的精确度。手动检查 RepliComment 过滤掉的 200 个额外的评论克隆是合法的,无法证明任何假阴性。

更新日期:2021-09-21
down
wechat
bug