A Novel Approach for Enhancing Code Smell Detection Using Random Convolutional Kernel Transform - Mostefai Abdelkader; Mekour Mansour (E-informatica : software engineering journal, 2025)
Context: In software engineering, the presence of code smells is closely associated with increased maintenance costs and complexities, making their detection and remediation an important concern. Objective: Despite numerous deep learning approaches for code smell detection, many still heavily rely on feature engineering processes (metrics) and exhibit limited performance. To address these shortcomings, this paper introduces CSDXR, a novel approach for enhancing code smell detection based on Random Convolutional Kernel Transform---a state-of-the-art technique for time series classification. The proposed approach does not rely on a manual feature engineering process and follows a three-step process: first, it converts code snippets into numerical sequences through tokenization; second, it applies Random Convolutional Kernel Transform to generate pooled models from these sequences; and third, it constructs a classifier from the pooled models to identify code smells. Method: The proposed approach was evaluated on four real-world datasets and compared against four state-of-the-art methods---DeepSmells, AE-Dense, AE-CNN, and AE-LSTM---in detecting Complex Method, Multifaceted Abstraction, Feature Envy, and Complex Conditional smells. Results: Empirical results demonstrate that CSDXR outperformed the four state-of-the-art methods---DeepSmells, AE-Dense, AE-CNN, and AE-LSTM---in detecting Complex Method and Multifaceted Abstraction smells. Specifically, the enhancement rates in terms of F1 score were 1.99% and 6.09% for Complex Method and Multifaceted Abstraction smells, respectively. In terms of MCC, the improvement rates were 0.82% and 35.64% for these two smells, respectively. The results also show that while DeepSmells achieves superior overall performance on Feature Envy and Complex Conditional smells, CSDXR surpasses AE-Dense, AE-CNN, and AE-LSTM in detecting these two types of smells. Conclusions: The paper concludes that the proposed approach, CSDXR, demonstrates significant potential for effectively detecting various types of code smells.