arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1603.01661cs.SE
收藏

SourcererCC和SourcererCC-I:在批处理模式和软件开发过程中检测克隆的工具

SourcererCC and SourcererCC-I: Tools to Detect Clones in Batch mode and During Software Development

Vaibhav Saini, Hitesh Sajnani, Jaewoo Kim, Cristina Lopes

摘要:

由于有大量的源代码存储库可用,因此已经有大量的应用程序用于大规模克隆检测。不幸的是,尽管经过了十年的积极研究,但仍明显缺乏可扩展到大型软件系统或大型存储库的克隆检测器,特别是用于检测在克隆代码中可能发生重大编辑活动的近距离(3型)克隆。本文论证了:(i)SourcerCC是一个基于标记的克隆检测器,以前三种克隆类型为目标,并利用索引实现使用标准工作站的大型项目间储存库的可扩展性。它使用优化的反向索引来快速查询给定代码块的潜在克隆。基于令牌排序的过滤算法用于显著减少索引的大小、检测克隆所需的代码块比较的数量以及判断潜在克隆所需的令牌比较的数量,以及(ii)SourcerCC-I,Eclipse插件,它使用SourcerCC的核心引擎在软件开发过程中实时识别和导航克隆(项目间和项目内)。在我们的实验中,将SourcerCC与最先进的工具进行比较,我们发现它是唯一一个在具有12 GB RAM的标准工作站上成功扩展到250 Mbit的克隆检测工具,并有效检测前三种类型的克隆(精确度86%,召回率86-100%)。演示链接:https://youtu.be/l7F_9Qp-ks4

英文摘要:

Given the availability of large source-code repositories, there has been a large number of applications for large-scale clone detection. Unfortunately, despite a decade of active research, there is a marked lack in clone detectors that scale to big software systems or large repositories, specifically for detecting near-miss (Type 3) clones where significant editing activities may take place in the cloned code. This paper demonstrates: (i) SourcererCC, a token-based clone detector that targets the first three clone types, and exploits an index to achieve scalability to large inter-project repositories using a standard workstation. It uses an optimized inverted-index to quickly query the potential clones of a given code block. Filtering heuristics based on token ordering are used to significantly reduce the size of the index, the number of code-block comparisons needed to detect the clones, as well as the number of required token-comparisons needed to judge a potential clone, and (ii) SourcererCC-I, an Eclipse plug-in, that uses SourcererCC's core engine to identify and navigate clones (both inter and intra project) in real-time during software development. In our experiments, comparing SourcererCC with the state-of-the-art tools, we found that it is the only clone detection tool to successfully scale to 250 MLOC on a standard workstation with 12 GB RAM and efficiently detect the first three types of clones (precision 86% and recall 86-100%). Link to the demo: https://youtu.be/l7F_9Qp-ks4

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

↑