DSFM: Enhancing Functional Code Clone Detection with Deep Subtree Interactions
Zhiwei Xu, Shaohua Qiang, Dinghong Song, Min Zhou, Hai Wan, Xibin Zhao, Ping Luo, Hongyu Zhang
Abstract
Functional code clone detection is important for software maintenance. In recent years, deep learning techniques are introduced to improve the performance of functional code clone detectors. By representing each code snippet as a vector containing its program semantics, syntactically dissimilar functional clones are detected. However, existing deep learning-based approaches attach too much importance to code feature learning, hoping to project all recognizable knowledge of a code snippet into a single vector. We argue that these deep learning-based approaches can be enhanced by considering the characteristics of syntactic code clone detection, where we need to compare the contents of the source code (e.g., intersection of tokens, similar flow graphs, and similar subtrees) to obtain code clones. In this paper, we propose a novel deep learning-based approach named DSFM, which incorporates comparisons between code snippets for detecting functional code clones. Specifically, we improve the typical deep clone detectors with deep subtree interactions that compare every two subtrees extracted abstract syntax trees (ASTs) of two code snippets, thereby introducing more fine-grained semantic similarity. By conducting extensive experiments on three widely-used datasets, GCJ, OJClone, and BigCloneBench, we demonstrate the great potential of deep subtree interactions in code clone detection task. The proposed DSFM outperforms the state-of-the-art approaches, including two traditional approaches, two unsupervised and four supervised deep learning-based baselines.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get aa5c136d-6387-4b23-817f-8db124160486Cited by top-tier papers2
- Feature Slice Matching for Precise Bug DetectionKe Ma, Jianjun Huang, Wei You, Bin Liang et al.FSE 2026
- LC3: Long Cross-Language Code Clone Detection Enhanced by Opcode Sequences and Affinity AggregationXilin Lan, Huan Zhang, Yang Yang, Chengwu Xue et al.AAAI 2026
Related papers
- Fine-Grained Code Clone Detection with Block-Based Splitting of Abstract Syntax TreeTiancheng Hu, Zijing Xu, Yilin Fang, Yueming Wu et al.ISSTA 2023 · 18 citations
- Functional code clone detection with syntax and semantics fusion learningChunrong Fang, Zixi Liu, Yangyang Shi, Jeff Huang et al.ISSTA 2020 · 125 citations
- Tritor: Detecting Semantic Code Clones by Building Social Network-Based Triads ModelDeqing Zou, Siyue Feng, Yueming Wu, Wenqi Suo et al.FSE 2023 · 6 citations
- Detecting Semantic Code Clones by Building AST-based Markov Chains ModelYueming Wu, Siyue Feng, Deqing Zou, Hai JinASE 2022 · 21 citations
- A Multiple Representation Transformer with Optimized Abstract Syntax Tree for Efficient Code Clone DetectionTianchen Yu, Li Yuan, Liannan Lin, Hongkui HeICSE 2025 · 1 citation
