## 4 Proposed Approach  
We propose an approach to combine GAN-based methods with boosting ensemble learning to handle the imbalance problem of software defects and improve the overall defect prediction. Our approach is a two-step approach as shown in Figure 1. In the first step, we use GAN-based methods to generate synthetic data from the minority class (i.e., defective modules). Then, we combine the generated synthetic data with the original data to produce a balanced dataset. In the second step, we employ a boosting ensemble on the balanced dataset to classify the modules in the software defects datasets. Our approach leverages the advantages of both GAN methods and boosting ensembles. GAN models have the ability to detect the overall data distribution and generate synthetic data that is very similar to the original data [5,6]. In addition, boosting ensemble has been proven to be suitable in handling imbalance problems by assigning a higher weight to the minority class [11,12]. Algorithm 2 outlines the algorithm of the proposed approach.  
\begin{table}
\begin{tabular}{c l l} \hline \hline
**Ref.** & **ML Models** & **Imbalance Techique** \\ \hline
[16] & DT, NB & RUS, ROS, SMOTE, SMOTEBoost, RUSBoost, MetaCost, \\
[29] & APE Ensemble model & Ensemble learning \\
[31] & EasyEnsemble & EasyEnsemble \\
[18] & Improved CNN & ROS \\
[17] & LR & ROS \\
[23] & SVM, RF, DT, NB, LR & VAE \\
[32] & Ensemble & ROS, MWMOTE, FIDos \\
[22] & Bagging, AdaBoost, SVM, DT, RF, LR & SMOTE \\
[33] & RNN & ROS \\  & BaggingModelANN, AdaBoost, CART, LR, MLP, RF, Ridge, SVMLibLinear, RBF SVM, WEKAModelADT, \\  & WEKAModelBayesNetTAN, J48, KNN, LMT, NB, RBF, \\  & Voted perceptron \\
[19] & C4.5, RF, RT, RIPPER, BN, NB, kNN, LMT, LR & RUS, SMOTE \\
[27] & KNN, LR, RF, DT, SVM & CWGAN-GP \\  & RF, Extra Trees, Adaboost, GB, Hist Gradient Boosting, \\  & XGBoost, CatBoost & SMOTE \\
[24] & Not mentioned & GAN \\
[35] & NN & SMOTE \\
[28] & RF, SVM, LR, DT & VAE, GAN, SMOTE \\
[36] & LR, DT, SVM, RF, ET, AdaBoost, GB, stacking ensemble, \\  & XGBoost \\
[25] & KNN, LR, NB, DT, RF, SVM & GAN \\
[20] & KNN, LR, DT, RF & SMOTE \\
[30] & Ensemble model & Ensemble model \\
[37] & KNN, LR, DT, RF, SVM & CWGAN-GP \\
[26] & KNN, RF, DT, NB, LR & GAN, CTGAN, WGANGP \\ This work & Boosting ensemble & GAN, CTGAN, WGANGP, ROS, RUS, SMOTE \\ \hline \hline \end{tabular}
\end{table}
Table 1: Related work summary.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Ref.** & **Imbalanced Technique** & **Domain** &
\begin{tabular}{c} **Hyperparameter** \\ **Optimization** \\ \end{tabular} & **Combined with Undersampling** \\ \hline
[27] & CWGAN-GP & Different & ✗ & ✗ \\
[24] & GAN & Defect & ✗ & ✗ \\
[28] & GAN & Fault & ✗ & ✗ \\
[25] & GAN & Software Aging & ✗ & ✗ \\
[37] & CWGAN-GP & Data security & ✓ & ✗ \\
[26] & GAN, CTGAN, WGANGP & Fault & ✗ & ✗ \\ This work & GAN, CTGAN, CWGANGP & Defect & ✓ & ✓ \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison between the previous studies that used GAN-based methods.  
```
0: Dataset \(D_{n}(x_{1},c_{1}),...,(x_{n},c_{n})\)
0: Imbalance classification model
1: Generate s synthetic samples
2: Create a new dataset \(D_{z}\) of size z by combining the synthetic samples with the original samples, where z = \(s+n\)
3: Initialize samples weights \(w_{i}=1/z\), \(i=1,...,z\)
4:for\(m\gets 1\) to M do
5: Train a weak learner \(T_{k}^{(m)}(x)\) on Distribution \(D_{z}\)
6: Obtain the weighted class probability estimates: \(p_{k}^{(m)}(x)=Prob_{w}(c=k|x),k=1,...,K\)
7: Set: \(h_{k}^{(m)}(x)\leftarrow(K-1)\left(log\,p_{k}^{(m)}(x)-\frac{1}{K}\sum_{k^{ \prime}}log\,p_{k^{\prime}}^{(m)}(x)\right)\), \(k=1,...,K\)
8: Set: \(w_{i}\gets w_{i}\cdot exp\left(-\frac{K-1}{K}\,y_{i}^{T}log\,p^{(m)}(x_{i} )\right),i=1,...,z\)
9: Re-normalize \(w_{i}\)
10:endfor
11: Output: \(C(x)=argmax\sum_{m=1}^{M}h_{k}^{(m)}(x)\)
```  
**Algorithm 2** Algorithm of the proposed approach