A Semantic-driven approach to detect Type-4 code clones by using AST and PDG
摘要
Type-4 code clone detection is difficult because a lot of conventional approaches based only on superficial syntactic and textual analysis, usually fail to achieve good performance for clones with similar meaning but with different syntax. To address this issue, a novel hybrid approach is proposed which aids in capturing the semantic relationships that exist within code by combining abstract syntax tree (AST) analysis with program dependency graph (PDG) representations. The code is initially pre-processed by partitioning data sets and classifying pairs with low similarity after applying semantic signatures. Then, AST and PDG are obtained to extract features from the code. It is followed by integration of graph neural networks (GNNs) which seamlessly carry node information aggregation in PDGs for providing sufficient control and data dependencies through message-passing mechanism. Through experiments performed on public datasets, the proposed approach shows better results thereby demonstrating the high effectiveness of the proposed framework for detecting large scale complex semantic clones in software systems.