# Machine Learning-Based Methods for Code Smell Detection: A Survey
### Motivation and Contribution  
The existing SLR discussed various ML algorithms, but class-wise categorizations need to be included [11; 12; 13; 14; 15; 16]. This SLR illustrates multiple studies of several classes of ML algorithms, the distribution of their subclasses, and the appropriate percentage for each study. This SLR also examined various sources to evaluate the effectiveness of various ML algorithms. Researchers presented and discussed many SLRs, datasets, and performance analysis tools but could not discuss software metrics that are found to be more helpful and the dataset language used in various studies [11; 14; 16]. The contributions of this SLR are listed below:  
1. The survey presents a unique approach to code smell detection, examining the SLR of forty-two papers (ARTN1 to ARTN42) from 2005 to 2024. 2. This study not only identifies various factors that can impact software quality, such as code smells, software metrics, and datasets, but also provides practical guidelines for addressing these issues. These guidelines include best practices for testing procedures, popular software metrics, and methods for detecting code smells, offering valuable insights for software practitioners. We investigate various factors that may distress any software. The survey also provides some guidelines for handling such problems. These guidelines are theoretical concepts and practical tools that empower professionals to address software quality issues effectively. We analyzed different issues in the code smell detection space and examined the current solution to those problems. Identifying and analyzing issues involves systematically searching and gathering relevant research articles and popular tools used in code smell detection. Examining the solution involves critically analyzing the methodologies, algorithms, and frameworks developed to address these issues. Based on our rigorous analysis, we identified best practices. This comprehensive approach reassures the audience about the validity and reliability of our findings, instilling confidence in the thoroughness of our research. Different ML algorithms were analyzed in this field, and it was found that the ML algorithms performed better in most cases. In this SLR, different classes of ML algorithms used for code smell detection (Decision Trees, Ensemble Learners, Bayesian Learners, Rule-Based Learning, Support Vector Machines, neural networks, and miscellaneous) are analyzed with their different algorithms. The primary goal of conducting this study is to examine, assess, and review the code smell detection methods from the following perspectives:  
1. The ML algorithms are used in this field. 2. Code smells that are being focused on in the literature. 3. Identification of frequently used metrics. 4. Identification of the metrics that appeared to be more effective. 5. Identification of various datasets. 6. Identification of datasets of different languages frequently used in this area. 7. Outlining the other performance measures used with various ML algorithms. Figure 1 represents the different SLR states, such as the planning, conducting, and reporting states. The planning stage contains two steps: Step 1: Originate the problem/need to conduct the SLR, define the specific requirement for the survey, and identify the object the SLR seeks to address. Step 2 is to expand the review protocol, which identifies research questions that need to be addressed in the SLR. These research questions are extracted from previously conducted SLRs and motivated by previous studies in this field. The related work is included in Section 2. Section 3 regards conducting the SLR process. In this stage, search questions are framed first (mentioned in Section 3.2); in the next step, these questions are searched in the literature from a list of resources (mentioned in Section 3.2). In the next step, the relevant articles from the previous step are selected. After this step, irrelevant research articles are eliminated by considering a selected research article's abstract, title, and conclusion.