Detecting code smells is vital for improving software quality, improving its maintainability, and reducing software failures and faults. Code smell detection using machine learning-based methods has become more prevalent in recent years, as they easily overcome the limitations of heuristic-based methods that are based mostly on rules that must be manually created. Data imbalance and parameter optimization are found to be directly affecting performance of underlying machine learning models. However, to the best of our knowledge about literature of the field, little experimental evaluation is carried out in the direction of impact of data balancing and parameter tuning on machine learning models. Therefore, this paper considers it important to propose a new data balancing and parameter optimization technique. Further, the proposed approach is experimentally validated by considering standard code smell datasets. The empirical evaluation considers four code smells taken from two categories (two at method level and rest of the two are considered at class level) and studied four machine learning models, viz., Decision Tree, Random Forest, kNN, and SVM. The obtained experimental results justify the suitability of proposed data balancing and parameter optimization techniques in improving performance of machine learning models.

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

Improving Machine Learning Algorithm’s Accuracy for Detecting Code Smell Using Data Balancing and Parameter Optimization

  • Abhishilpa Nandini,
  • Randeep Singh,
  • Amit Rathee

摘要

Detecting code smells is vital for improving software quality, improving its maintainability, and reducing software failures and faults. Code smell detection using machine learning-based methods has become more prevalent in recent years, as they easily overcome the limitations of heuristic-based methods that are based mostly on rules that must be manually created. Data imbalance and parameter optimization are found to be directly affecting performance of underlying machine learning models. However, to the best of our knowledge about literature of the field, little experimental evaluation is carried out in the direction of impact of data balancing and parameter tuning on machine learning models. Therefore, this paper considers it important to propose a new data balancing and parameter optimization technique. Further, the proposed approach is experimentally validated by considering standard code smell datasets. The empirical evaluation considers four code smells taken from two categories (two at method level and rest of the two are considered at class level) and studied four machine learning models, viz., Decision Tree, Random Forest, kNN, and SVM. The obtained experimental results justify the suitability of proposed data balancing and parameter optimization techniques in improving performance of machine learning models.