Litcius/Paper detail

Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection

Siyue Feng, Wenqi Suo, Yueming Wu, Deqing Zou, Yang Liu, Hai Jin

202420 citationsDOI

Abstract

As software engineering advances and the code demand rises, the prevalence of code clones has increased. This phenomenon poses risks like vulnerability propagation, underscoring the growing importance of code clone detection techniques. While numerous code clone detection methods have been proposed, they often fall short in real-world code environments. They either struggle to identify code clones effectively or demand substantial time and computational resources to handle complex clones. This paper introduces a code clone detection method namely Toma using tokens and machine learning. Specifically, we extract token type sequences and employ six similarity calculation methods to generate feature vectors. These vectors are then input into a trained machine learning model for classification. To evaluate the effectiveness and scalability of Toma, we conduct experiments on the widely used BigCloneBench dataset. Results show that our tool outperforms token-based code clone detectors and most tree-based clone detectors, demonstrating high effectiveness and significant time savings.

Topics & Concepts

Computer scienceclone (Java method)Security tokenCode (set theory)Source codeScalabilityArtificial intelligenceMachine learningProgramming languageOperating systemDNASet (abstract data type)GeneticsBiologySoftware Engineering ResearchAdvanced Malware Detection TechniquesSoftware Reliability and Analysis Research