Enhancing Semantic Clone Detection with Siamese Bi-LSTM for Multi-Level Source Code Representations
摘要
Source code clone detectors are fundamental techniques in Software Engineering. Despite significant research efforts in the last ten years, current methods still need to be improved to detect semantic clones. The advancement of machine learning techniques has garnered the attention of researchers, motivating them to propose new methods for detecting semantic clones. However, many existing methods rely on manually crafted features to represent the syntactic and semantic information of source code, which hampers the detection of semantic clone pairs. This paper introduces a new approach for identifying semantic clones by leveraging the capabilities of the Siamese bidirectional long short-term memory technique to learn hidden syntactic and semantic patterns in source code representations. This technique transforms source code into two distinct representations: a high-level source code representation abstract syntax tree and a low-level abstract compiled code intermediate representation (Baf and Jimple block Program Dependency Graph). Extensive experiments were conducted on a large dataset of Java programs (BigCloneBench) to evaluate the effectiveness of the proposed technique. The results demonstrate that the proposed approach outperforms the baseline methods, including CCLearner, SourcererCC, NiCad, iClones, CCFinder, Oreo, and Deckard, in terms of the F1-score for detecting complex clone types such as MT-3 (94%) and WT-3/4 (93%). Furthermore, it outperforms CDLH, DLC, ASTNN, and Quradaa et al. in terms of F1-score performance for clone identification across VST-3 (97%), ST-3 (98%), MT-3 (94%), and WT-3/4 (93%), achieving an average F1-score of 95.5%. These results highlight its superior detection capability.