paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Fine-Grained Code Clone Detection with Block-Based Splitting of Abstract Syntax Tree

基于抽象语法树分块的细粒度代码克隆检测
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 2/10 · 该论文属于传统代码克隆检测的静态分析工作,基于AST拆分实现细粒度克隆检测,未涉及LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析等用户核心方向。虽然属于程序分析范畴,但与用户研究画像的核心交叉点匹配度很低。引用 23 inbox
Tiancheng Hu, Zijing Xu, Yilin Fang, Yueming Wu, Bin Yuan, Deqing Zou, Hai Jin
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 Tamer,将抽象语法树拆分为简单子树,实现可扩展且细粒度的语法代码克隆检测。

代码克隆检测旨在发现相似代码片段,在软件工程中日益重要。文本或词法方法高效可扩展,但忽略语法,难以检测语法克隆;基于树的方法虽能检测语法或语义克隆,却通常耗时、可扩展性差,且无法细粒度定位具体克隆块。本文提出 Tamer:将复杂抽象语法树转换为简单子树,以加速检测,并对克隆对做细粒度分析,定位具体克隆部分。在 BigCloneBench 上,Tamer 与 CCAligner、SourcererCC、Siamese、NIL、NiCad、LVMapper、Deckard、Yang2018、CCFinder、CloneWorks 等十种最新工具相比表现更优。

问题
现有代码克隆检测中,文本/词法方法可扩展但忽略语法,树方法能检测语法或语义克隆却耗时、难扩展且无法细粒度定位具体克隆块。
方法
提出 Tamer,将复杂抽象语法树拆分为简单子树以加速检测,并通过克隆对的细粒度分析定位具体克隆代码部分。
评估
在 BigCloneBench 数据集上与十种最新代码克隆检测工具比较,包括 CCAligner、SourcererCC、Siamese、NIL、NiCad、LVMapper、Deckard、Yang2018、CCFinder 和 CloneWorks,Tamer 表现更优。
原文摘要(Abstract)

Code clone detection aims to find similar code fragments and gains increasing importance in the field of software engineering. There are several types of techniques for detecting code clones. Text-based or token-based code clone detectors are scalable and efficient but lack consideration of syntax, thus resulting in poor performance in detecting syntactic code clones. Although some tree-based methods have been proposed to detect syntactic or semantic code clones with decent performance, they are mostly time-consuming and lack scalability. In addition, these detection methods can not realize fine-grained code clone detection. They are unable to distinguish the concrete code blocks that are cloned. In this paper, we design Tamer, a scalable and fine-grained tree-based syntactic code clone detector. Specifically, we propose a novel method to transform the complex abstract syntax tree into simple subtrees. It can accelerate the process of detection and implement the fine-grained analysis of clone pairs to locate the concrete clone parts of the code. To examine the detection performance and scalability of Tamer, we evaluate it on a widely used dataset BigCloneBench. Experimental results show that Tamer outperforms ten state-of-the-art code clone detection tools (i.e., CCAligner, SourcererCC, Siamese, NIL, NiCad, LVMapper, Deckard, Yang2018, CCFinder, and CloneWorks).

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{HuXFWYZ023,
  title = {Fine-Grained Code Clone Detection with Block-Based Splitting of Abstract Syntax Tree},
  author = {Tiancheng Hu and Zijing Xu and Yilin Fang and Yueming Wu and Bin Yuan and Deqing Zou and Hai Jin},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598040}
}