<p>Code smells are structural design symptoms that negatively impact software maintainability and often correlate with fault‐proneness and architectural degradation. Automatic detection of such smells is essential for prioritizing refactoring tasks and reducing long-term technical debt. In this article, a hybrid Long Short-Term Memory–Convolutional Neural Network architecture is proposed for detecting four major code smells—Data Class, God Class, Feature Envy, and Long Method—using metric-based representations extracted from Java projects. The model utilizes Chi-square feature selection, SMOTE oversampling, and a sequence-aware learning framework to capture both temporal and spatial relationships among software metrics. Extensive experiments were conducted using tenfold cross-validation and compared against ensemble models and standalone deep learning baselines. The proposed method achieved an average accuracy of 99.7%, F1-score of 99.6%, mean AUC of 0.987, and robustness metrics including MCC = 0.985 and Cohen’s Kappa = 0.985. A comprehensive set of ablation studies demonstrated the importance of hybrid modeling and the effectiveness of top-k Chi-square feature subsets. Compared with 10 state-of-the-art studies published after 2020, the proposed approach demonstrates superior performance and generalizability across multiple smell categories. Limitations related to dataset scope and metric-only representations are discussed, and several future research directions are proposed.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Code Smell Detection Using a Hybrid LSTM-CNN Deep Learning Approach with Optimized Software Metrics

  • Aliakbar Tajari Siahmarzkooh

摘要

Code smells are structural design symptoms that negatively impact software maintainability and often correlate with fault‐proneness and architectural degradation. Automatic detection of such smells is essential for prioritizing refactoring tasks and reducing long-term technical debt. In this article, a hybrid Long Short-Term Memory–Convolutional Neural Network architecture is proposed for detecting four major code smells—Data Class, God Class, Feature Envy, and Long Method—using metric-based representations extracted from Java projects. The model utilizes Chi-square feature selection, SMOTE oversampling, and a sequence-aware learning framework to capture both temporal and spatial relationships among software metrics. Extensive experiments were conducted using tenfold cross-validation and compared against ensemble models and standalone deep learning baselines. The proposed method achieved an average accuracy of 99.7%, F1-score of 99.6%, mean AUC of 0.987, and robustness metrics including MCC = 0.985 and Cohen’s Kappa = 0.985. A comprehensive set of ablation studies demonstrated the importance of hybrid modeling and the effectiveness of top-k Chi-square feature subsets. Compared with 10 state-of-the-art studies published after 2020, the proposed approach demonstrates superior performance and generalizability across multiple smell categories. Limitations related to dataset scope and metric-only representations are discussed, and several future research directions are proposed.