The Performance Analysis of Machine Learning Techniques in Code Smell Detection
In scope of this work, models capable of detecting code smells using machine learning in C++ projects have been developed. In this context, the Clean++ tool was used to analyze four open-source C++ projects, to obtain class-based metrics and Lazy Class code smell-labeled positive and negative class samples. A labeled code smell dataset consisting of 409 instances was created. Machine learning models using KNearest Neighbors, Decision Tree, Multi-Layer Perceptron, Logistic Regression, Random Forest Classifier, Support Vector Classifier and Naïve Bayes algorithms were developed and model trainings were conducted on the generated dataset. Hyperparameter optimization was performed to determine the optimal parameters for each model. The performance analysis of the models trained with the optimal parameters was conducted on a separate test dataset comprising 20% of the initial data, using accuracy, precision, recall and F1 score evaluation metrics. The model which was trained with K-Nearest Neighbors algorithm exhibited the most successful performance, achieving an accuracy of 93.902% and a F1 score of 82.758%. Second highest performance was the model with Random Forest Classifier algorithm, which performed with 91.463% accuracy and 77.419% F1 score. However, the F1 scores of the other 5 models remained below 75%.
Authors
- Oya Kalıpsız (ORCID: https://orcid.org/0000-0001-9553-669X)
- A. Gökhan Yavuz (ORCID: https://orcid.org/0000-0002-6490-0396)
Publication Details
- Published
- 2024-10-26
- DOI
- https://doi.org/10.1109/ubmk63289.2024.10773525
- Citations
- 1
- Primary Topic
- Network Security and Intrusion Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.35