# Machine Learning-Based Methods for Code Smell Detection: A Survey
###### Abstract  
Code smells are early warning signs of potential issues in software quality. Various techniques are used in code smell detection, including the Bayesian approach, rule-based automatic antipattern detection, antipattern identification utilizing B-splines, Support Vector Machine direct, SMURF (Support Vector Machines for design smell detection using relevant feedback), and immune-based detection strategy. Machine learning (ML) has taken a great stride in this area. This study includes relevant studies applying ML algorithms from 2005 to 2024 in a comprehensive manner for the survey to provide insight regarding code smell, ML algorithms frequently applied, and software metrics. Forty-two pertinent studies allow us to assess the efficacy of ML algorithms on selected datasets. After evaluating various studies based on open-source and project datasets, this study evaluated additional threats and obstacles to code smell detection, such as the lack of standardized code smell definitions, the difficulty of feature selection, and the challenges of handling large-scale datasets. The current studies only considered a few factors in identifying code smells, while in this study, several potential contributing factors to code smells are included. Several ML algorithms are examined, and various approaches, datasets, dataset languages, and software metrics are presented. This study provides the potential of ML algorithms to produce better results and fills a gap in the body of knowledge by providing class-wise distributions of the ML algorithms. Support Vector Machine, J48, Naive Bayes, and Random Forest models are the most common for detecting code smells. Researchers can find this study helpful in better anticipating and taking care of software development design and implementation issues. The findings from this study, which highlight the practical implications of ML algorithms in software quality improvement, will help software engineers fix problems during software design and development to ensure software quality. Keywords:antipattern; code smell; code smell detection; identification; machine learning algorithms +
Footnote †: journal: Medical  
Solutions based on ML have proven very useful for complicated issues that challenge conventional approaches; because of that, this study is mainly focused on ML-based approaches. In the literature, many ML algorithms are used, such as Decision Tree, Decision Tree (J48), Decision Tree (c4.5), Naive Bayes, Support Vector Machines (SVMs), Random Forest, etc. [PERSON] et al. [7] applied thirty-two ML algorithms like AdaBoost, J48, Random Forest, Naive Bayes, JRip, LIBSVM, Sequential Minimal Optimization, etc. They found 96% accuracy and 90% F-measure, the best-known results compared to the other works in this area. [PERSON] et al. [8] applied some ML algorithms with a 10-fold cross-validation method, including the J48 (C4.5) algorithm, Random Forest, JRip, Naive Bayes, Sequential Minimal Optimization, and K-nearest neighbors (where k = 2), and found that tree-based classifiers provide better results among all applied algorithms. [PERSON] et al. [9] anticipated two skeletons, one with feature selection and the other without feature selection. They compared their results with techniques such as Multilayer Perceptron, SVM, Rule-Based Learning, Naive Bayes, K-nearest neighbors, Random Forest, etc. They observed that their method performed better than these classification methods. [PERSON] et al. [10] compared ML algorithms with DECOR (DEtection and CORrection), a heuristic-based approach on thirteen open-source software systems, and noticed that DECOR generally provides a better result than ML algorithms. This study presents a systematic literature review (SLR) to find the applications of ML-based methods in code smell detection. The investigation examined various factors that influence the performance of code smell detection, including the ML algorithm employed, feature selection, evaluation metrics for quality assessment, software metrics, and datasets.