Structural Function Based Code Clone Detection Using a New Hybrid Technique
Yanming Yang, Zhilei Ren, Xin Chen, He Jiang · 2018
In this paper, we focus on investigating function based code clone detection and leveraging the structural information to measure the similarity of code fragments in the function level. The method first combines a variant of Abstract Syntax Tree(AST) to achieve more abstract code representations by using defined node types instead of the original node representations, and then adopts a local comparison algorithm, namely Smith Waterman, to calculate the similarity scores of pairs of code fragments in the function level. Experiments conducted over the five open-source datasets show that our method can achieve 92.46% in precision on average, and outperform the comparative algorithms by up to 10.94% and 4.02%, respectively. Meanwhile, experimental results show that our method can achieve 90.73% in precision on average in code clone detection over cross-projects.