paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Comparison and Evaluation of Clone Detection Techniques with Different Code Representations

不同代码表示下的克隆检测技术比较与评估
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 3/10 · 论文属于代码克隆检测与程序表示的经验比较,虽与程序分析/静态分析相关,但未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,也不是面向 ML/Agentic 程序的静态分析。引用 28 inbox
Yuekun Wang, Yuhang Ye, Yueming Wu, Weiwei Zhang, Yinxing Xue, Yang Liu
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:复现12种算法比较代码表示对克隆检测的影响,并组合 token 与树表示实现 TACC。

代码克隆会增加维护成本并带来漏洞传播风险。已有克隆检测技术可按代码表示分为文本、token、树、图等,但不同表示的有效性及组合方式尚不明确。本文复现12种克隆检测算法并按表示分组开展实证比较,发现 token 和树表示在简单克隆上优于图表示,而代码对复杂度升高时图表示更有效。作者进一步人工分析开源项目,观察到多数克隆对属于简单克隆,因此舍弃重量级图方法,探索 token 与树表示的组合,实现工具 TACC,并与当前最优检测器评估。结果表明 TACC 性能更优且具备大规模克隆检测能力。

问题
不同代码表示(文本、token、树、图)对克隆检测效果的影响尚不明确,且如何组合不同表示以兼顾有效性与可扩展性也缺少系统结论。
方法
复现12种克隆检测算法并按代码表示分组进行实证比较;同时对开源项目做人工分析以了解克隆类型分布,并据此组合 token-based 与 tree-based 方法实现工具 TACC。
评估
将 TACC 与其他最先进克隆检测器进行对比实验,结果显示 TACC 性能更好,并能够检测大规模代码克隆。
原文摘要(Abstract)

As one of bad smells in code, code clones may increase the cost of software maintenance and the risk of vulnerability propagation. In the past two decades, numerous clone detection technologies have been proposed. They can be divided into text-based, token-based, tree-based, and graph-based approaches according to their code representations. Different code representations abstract the code details from different perspectives. However, it is unclear which code representation is more effective in detecting code clones and how to combine different code representations to achieve ideal performance. In this paper, we present an empirical study to compare the clone detection ability of different code representations. Specifically, we reproduce 12 clone detection algorithms and divide them into different groups according to their code representations. After analyzing the empirical results, we find that token and tree representations can perform better than graph representation when detecting simple code clones. However, when the code complexity of a code pair increases, graph representation becomes more effective. To make our findings more practical, we perform manual analysis on open-source projects to seek a possible distribution of different clone types in the open-source community. Through the results, we observe that most clone pairs belong to simple code clones. Based on this observation, we discard heavyweight graph-based clone detection algorithms and conduct combination experiments to find out a suitable combination of token-based and tree-based approaches for achieving scalable and effective code clone detection. We develop the suitable combination into a tool called TACC and evaluate it with other state-of-the-art code clone detectors. Experimental results indicate that TACC performs better and has the ability to detect large-scale code clones.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{WangYWZXL23,
  title = {Comparison and Evaluation of Clone Detection Techniques with Different Code Representations},
  author = {Yuekun Wang and Yuhang Ye and Yueming Wu and Weiwei Zhang and Yinxing Xue and Yang Liu},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00039}
}