arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2108.11205cs.SE
收藏

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

RepliComment: Identifying Clones in Code Comments

Arianna Blasi, Nataliia Stulova, Alessandra Gorla, Oscar Nierstrasz

摘要:

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

英文摘要:

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

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑