CBReT: A Cluster-Based Resampling Technique for dealing with imbalanced data in code smell prediction

Praveen Singh Thakur,Mahipal Jadeja,Satyendra Singh Chouhan
DOI: https://doi.org/10.1016/j.knosys.2024.111390
IF: 8.139
2024-02-01
Knowledge-Based Systems
Abstract:Code smell refers to substandard design patterns in software’s source code that may lead to faults-prone implementation. Machine learning-based code smell prediction models suffer from data imbalance problems, i.e., one class contains significantly more instances than another. The existing oversampling approaches, such as SMOTE (Synthetic Minority Over-sampling Technique), have been used for balancing the code smell dataset by generating synthetic samples for the minority class. However, the distribution of classes of code smell datasets is overlapped; hence, randomly generated instances can damage the decision boundary between both classes. This paper addresses this issue and proposes a novel Cluster-Based Resampling Technique, CBReT, that generates synthetic instances by considering the distribution of the code smell data. The CBReT first formulates clusters (containing minority and majority instances) based on the data distribution using Gaussian Mixture Model (GMM). Next, each cluster is balanced separately by synthesizing minority instances. While balancing the clusters, the CBReT also checks the validity of the synthetic instances so that each synthetic instance holds similar properties as the other minority instances. To assess the performance of CBReT, extensive experiments have been conducted on the four publicly available benchmark code smell datasets. We have used various performance metrics to evaluate our model’s performance. The experimental results show that the CBReT technique significantly increased the performance of the code smell prediction model by 0.18% (min) and 9.08% (max) compared to the state-of-the-art imbalance learning approaches.
computer science, artificial intelligence
What problem does this paper attempt to address?