Data preprocessing for machine learning based code smell detection: A systematic literature review
Detecting code smells using Machine Learning presents inherent challenges due to the unbalanced nature of the problem and susceptibility to interpretation biases. It is a data-driven process for code quality assurance that aims to detect if a given piece of code presents a fundamental design principles violation that negatively impacts design quality. Researchers in the field have been advised to carefully analyze the internal mechanisms of forecasting models before interpreting the results generated by them. The review aims to summarize and synthesize studies that utilized Data Preprocessing techniques for Machine Learning-based code smell detection. And also, to investigate the relationship between Data Preprocessing and more advanced Machine Learning techniques , i.e., Ensemble Methods , Deep Learning , and Transfer Learning . To obtain insights into Data Preprocessing for Machine Learning-based code smell detection solutions, we employed a systematic approach, identifying and analyzing 69 studies published up to November 2023. In Data Preprocessing, Data Balancing techniques, Feature Selection techniques, and Filtering emerged as prominent strategies. SMOTE was the most frequently used Data Balancing technique, while Autoencoder , Chi-square, Gain Ratio, Information Gain , PCA , and CFS were notable choices for Feature Selection. Tokenization and Syntax Trees were commonly paired with Deep Learning or Transfer Learning methods. Normalization and Standardization were implemented for Data Scaling. Regarding Machine Learning techniques used with Data Preprocessing, 46% of the combinations occurred with at least one Ensemble Method. Deep Learning was employed in 37% of cases. Data Balancing techniques combined with Deep Learning (32%) or Ensemble Methods (19%) were used most. The findings of this SLR are an integrated and comprehensive source of information regarding data preparation practices, challenges, and solutions for Machine Learning-based code smell detection, emphasizing the continuous endeavor towards more resilient, contextually sensitive, and developer-informed strategies within this dynamic field. • Custom Data Balancing and Feature Selection enhance code smell detection. • Ensemble Methods boost accuracy but face complexity and resource challenges. • Capturing code semantics with DL and TL is promising in cross-language scenarios. • Balancing accuracy, scalability, and semantic understanding is key to robustness.
Authors
- Ricardo Choren Noya (ORCID: https://orcid.org/0000-0003-4081-2647)
- Fábio do Rosario Santos (ORCID: https://orcid.org/0009-0009-9969-2054)
Institutions
- Military Institute of Engineering (BR)
Publication Details
- Journal
- Information and Software Technology
- Published
- 2025-04-25
- DOI
- https://doi.org/10.1016/j.infsof.2025.107752
- Citations
- 2
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 3.25