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

Enhancing software code smell detection with modified cost-sensitive SVM

  • Praveen Singh Thakur,
  • Mahipal Jadeja,
  • Satyendra Singh Chouhan

摘要

Code Smell detection is a crucial task in software systems. The code smell can negatively impact software maintenance and evolution. The machine learning-based code smell detection model suffers from the data imbalance problem where the number of instances belonging to both classes significantly differ. Existing oversampling approaches, such as SMOTE, have addressed this issue by generating synthetic samples for the minority class to balance the code smell dataset. However, the distribution of code smell datasets often overlaps, meaning randomly generated instances can disrupt the decision boundary between the two classes. This article addresses the problem of imbalanced data in code smell prediction. It presents a novel approach called MC-CSP (Modified Cost-sensitive approach for Code Smell Prediction). Unlike existing cost-sensitive based approaches, it employs a novel approach of allocating different weights to each positive instance, considering their role and importance in the classification task. The MC-CSP calculates the Margin Violation Value (MVV) for each instance. Subsequently, based on the MVV’s values, it identifies minority instances that have been misclassified or classified near the decision boundary. In order to enhance the classifier’s performance for the minority class, MC-CSP updates the weights of such minority instances based on their geometric proximity to the decision boundary. The proposed MC-CSP model has been evaluated on seven code smell datasets and compared with the state-of-the-art approaches. The experimental results demonstrate that MC-CSP outperforms other state-of-the-art methods by improving the prediction performance by \(1.5\%\) 1.5 % (minimum) to \(20.29\%\) 20.29 % (maximum).