Fine-Grained Code Clone Detection with Block-Based Splitting of Abstract Syntax Tree
Tiancheng Hu, Zijing Xu, Yilin Fang, Yueming Wu, Bin Yuan, Deqing Zou, Hai Jin
摘要
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).
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection 引用了 CCGraph: a PDG-based code clone detector with approximate graph matching
- Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection 引用了 SCDetector: Software Functional Clone Detection Based on Semantic Tokens Analysis
- Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection 引用了 NIL: large-scale detection of large-variance clones
- InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees 引用了 Functional code clone detection with syntax and semantics fusion learning
- NIL: large-scale detection of large-variance clones 引用了 CCGraph: a PDG-based code clone detector with approximate graph matching
- FIRE: Combining Multi-Stage Filtering with Taint Analysis for Scalable Recurring Vulnerability Detection 引用了 Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection
- CC2Vec: Combining Typed Tokens with Contrastive Learning for Effective Code Clone Detection 引用了 SCDetector: Software Functional Clone Detection Based on Semantic Tokens Analysis
- CC2Vec: Combining Typed Tokens with Contrastive Learning for Effective Code Clone Detection 引用了 NIL: large-scale detection of large-variance clones
- VulSCA: A Community-Level SCA Approach for Accurate C/C++ Supply Chain Vulnerability Analysis 引用了 Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection
- VulSCA: A Community-Level SCA Approach for Accurate C/C++ Supply Chain Vulnerability Analysis 引用了 FIRE: Combining Multi-Stage Filtering with Taint Analysis for Scalable Recurring Vulnerability Detection
引用它的顶会 Paper5
- Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone DetectionSiyue Feng, Wenqi Suo, Yueming Wu, Deqing Zou 等ICSE 2024 · 20 次引用
- FIRE: Combining Multi-Stage Filtering with Taint Analysis for Scalable Recurring Vulnerability DetectionSiyue Feng, Yueming Wu, Wenjie Xue, Sikui Pan 等USENIX Security 2024 · 13 次引用
- CC2Vec: Combining Typed Tokens with Contrastive Learning for Effective Code Clone DetectionShihan Dou, Yueming Wu, Haoxiang Jia, Yuhao Zhou 等FSE 2024 · 9 次引用
- Calico: Automated Knowledge Calibration and Diagnosis for Elevating AI Mastery in Code TasksYuxin Qiu, Jie Hu, Qian Zhang, Heng YinISSTA 2024 · 3 次引用
- VulSCA: A Community-Level SCA Approach for Accurate C/C++ Supply Chain Vulnerability AnalysisYutao Hu, Chaofan Li, Yueming Wu, Yifeng Cai 等NDSS 2026 · 1 次引用
它引用的 Paper5
- Functional code clone detection with syntax and semantics fusion learningChunrong Fang, Zixi Liu, Yangyang Shi, Jeff Huang 等ISSTA 2020 · 125 次引用
- InferCode: Self-Supervised Learning of Code Representations by Predicting SubtreesNghi D. Q. Bui, Yijun Yu, Lingxiao JiangICSE 2021 · 106 次引用
- SCDetector: Software Functional Clone Detection Based on Semantic Tokens AnalysisYueming Wu, Deqing Zou, Shihan Dou, Siru Yang 等ASE 2020 · 55 次引用
- CCGraph: a PDG-based code clone detector with approximate graph matchingYue Zou, Bihuan Ban, Yinxing Xue, Yun XuASE 2020 · 46 次引用
- NIL: large-scale detection of large-variance clonesTasuku Nakagawa, Yoshiki Higo, Shinji KusumotoFSE 2021 · 41 次引用
相关 Paper
- Detecting Semantic Code Clones by Building AST-based Markov Chains ModelYueming Wu, Siyue Feng, Deqing Zou, Hai JinASE 2022 · 21 次引用
- Tritor: Detecting Semantic Code Clones by Building Social Network-Based Triads ModelDeqing Zou, Siyue Feng, Yueming Wu, Wenqi Suo 等FSE 2023 · 6 次引用
- TreeCen: Building Tree Graph for Scalable Semantic Code Clone DetectionYutao Hu, Deqing Zou, Junru Peng, Yueming Wu 等ASE 2022 · 30 次引用
- DSFM: Enhancing Functional Code Clone Detection with Deep Subtree InteractionsZhiwei Xu, Shaohua Qiang, Dinghong Song, Min Zhou 等ICSE 2024 · 7 次引用
- Comparison and Evaluation of Clone Detection Techniques with Different Code RepresentationsYuekun Wang, Yuhang Ye, Yueming Wu, Weiwei Zhang 等ICSE 2023 · 15 次引用
