Code Clone Detection Using Boosting Algorithms

M.V. Thanoshan, Banujan Kuhaneswaran, Banage T. G. S. Kumara, S. Prasanth, Zhenni Li, Incheon Paik · 2023

To increase programming productivity, developers often copy and paste the source code with or without changing it. However, they may also introduce significant downsides in the long run, including complicating the software and raising maintenance costs. The activity of duplicating the code is known as code cloning. They are classified into four types - Type-1, Type-2, Type-3, and Type-4. In this paper, the author presents a machine-learning approach for detecting code clones of all kinds except for Type-2. Abstract Syntax Trees are used to extract features from the methods. A distance combination approach combines two feature vectors of a pair of methods and their class labels. Once the dataset is finalised, a machine- learning approach is utilised to classify the clone type. Moreover, boosting classifiers like XGBoost, CatBoost, LightGBM, Gradient Boosting and AdaBoost are evaluated for the highest classification accuracy. From the results obtained, LightGBM outperformed all the other classifiers with the highest F1 score of 0.81. This study would motivate future researchers to focus on identifying the Type-2 clones and extracting novel features in determining the clone types.

Read the paper · More papers on PaperTik