arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.03435cs.SEcs.PL
收藏

StoneDetector: 传统且多功能的Java代码克隆检测

StoneDetector: Conventional and versatile code clone detection for Java

Cooperative University Gera-Eisenach(格拉-艾森纳赫合作大学);Friedrich Schiller University Jena(耶拿弗里德里希·席勒大学)

Thomas S. Heinze, André Schäfer, Wolfram Amme

AI总结:

StoneDetector通过支配树派生路径的文本比较,实现传统且多功能的Java代码克隆检测,具备高性能和可扩展性。

摘要:

在软件开发过程中,复制粘贴是一种常见的实践,因此在软件项目中频繁出现被复制并随后修改的代码。由于此类代码克隆,即完全或相似的代码片段,会膨胀软件项目并导致诸如错误或漏洞传播等问题,因此识别它们非常重要。本文中,我们介绍了StoneDetector及其用于在Java源代码和字节码中查找代码克隆的方法。StoneDetector实现了一种基于代码表示的支配树派生路径的文本比较的传统克隆检测方法。通过这种方式,该工具不仅能够发现精确且语法相似的近似代码克隆,还能发现由于语法多样性较大而较难检测的代码克隆。我们展示了StoneDetector作为传统克隆检测工具的多功能性,并分析了其各种可用的配置参数,包括使用不同的字符串度量标准、哈希算法等。在与其他传统克隆检测器在多个最先进的基准测试中的全面评估中,我们展示了StoneDetector在查找Java源代码和字节码中克隆代码的性能和可扩展性。

英文摘要:

Copy & paste is a widespread practice when developing software and, thus, duplicated and subsequently modified code occurs frequently in software projects. Since such code clones, i.e., identical or similar fragments of code, can bloat software projects and cause issues like bug or vulnerability propagation, their identification is of importance. In this paper, we present StoneDetector and its underlying method for finding code clones in Java source and Bytecode. StoneDetector implements a conventional clone detection approach based upon the textual comparison of paths derived from the code's representation by dominator trees. In this way, the tool does not only find exact and syntactically similar near-miss code clones, but also code clones that are harder to detect due to their larger variety in the syntax. We demonstrate StoneDetector's versatility as a conventional clone detection tool and analyze its various available configuration parameters, including the usage of different string metrics, hashing algorithms, etc. In our exhaustive evaluation with other conventional clone detectors on several state-of-the-art benchmarks, we can show StoneDetector's performance and scalability in finding code clones in both, Java source and Bytecode.

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

↑