Good software design plays an essential role in the software life cycle; refactoring the code smell found during the early stages of software design activity introduces a perfect model design. Finding the code smell manually requires excessive work and is time-consuming. Researchers investigated whether machine learning (ML) models can efficiently be leveraged for code smell detection. In addition to the efficient usage of ML in code smell detection areas, several researchers apply various types of data over-sampling to handle imbalanced dataset issues. Therefore, this paper proposes a new model for code smell detection utilizing the so-called Generative Adversarial Networks (GANS) to over-sample minor smelly code samples. Additionally, this research presents a comparative study focused on using different over-sampling methods, such as SMOTE, and their variations during smell detection. A sequence of experiments has been conducted using five Machine Learning (ML) models using different evaluation metrics: precision, accuracy, recall, and F1 score, which aimed to detect God-class and Data-class at the class level, Long-Method and Feature-Envy and at the method level. All the experimental results indicate that our proposed approach introduced the best result, 99.9% accuracy, by leveraging the GANS compared with other SMOTE methods for generating synthetic samples. Additionally, our work outperformed related research on God-class and feature-envy datasets.

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

Code Smell Detection Using ML Techniques Leveraging GANs as Oversampling Method

  • Saleem Alsaraireh,
  • Abdallah Qusef,
  • Qasem Abu Al-Haija,
  • Laith Al Shaggah

摘要

Good software design plays an essential role in the software life cycle; refactoring the code smell found during the early stages of software design activity introduces a perfect model design. Finding the code smell manually requires excessive work and is time-consuming. Researchers investigated whether machine learning (ML) models can efficiently be leveraged for code smell detection. In addition to the efficient usage of ML in code smell detection areas, several researchers apply various types of data over-sampling to handle imbalanced dataset issues. Therefore, this paper proposes a new model for code smell detection utilizing the so-called Generative Adversarial Networks (GANS) to over-sample minor smelly code samples. Additionally, this research presents a comparative study focused on using different over-sampling methods, such as SMOTE, and their variations during smell detection. A sequence of experiments has been conducted using five Machine Learning (ML) models using different evaluation metrics: precision, accuracy, recall, and F1 score, which aimed to detect God-class and Data-class at the class level, Long-Method and Feature-Envy and at the method level. All the experimental results indicate that our proposed approach introduced the best result, 99.9% accuracy, by leveraging the GANS compared with other SMOTE methods for generating synthetic samples. Additionally, our work outperformed related research on God-class and feature-envy datasets.