[Paper Review] Generative Adversarial Network-based Cross-Project Fault Prediction
This paper proposes a GAN-based domain adaptation method for cross-project software fault prediction (CPDP), where a generator transforms target project data to match the source project's distribution, reducing data divergence. The approach achieves strong F1-measure performance, especially when JDT is the target project, though class imbalance remains a key challenge.
Background: The early stage of defect prediction in the software development life cycle can reduce testing effort and ensure the quality of software. Due to the lack of historical data within the same project, Cross-Project Defect Prediction (CPDP) has become a popular research topic among researchers. CPDP trained classifiers based on labeled data sets of one project to predict fault in another project. Goals: Software Defect Prediction (SDP) data sets consist of manually designed static features, which are software metrics. In CPDP, source and target project data divergence is the major challenge in achieving high performance. In this paper, we propose a Generative Adversarial Network (GAN)-based data transformation to reduce data divergence between source and target projects. Method: We apply the Generative Adversarial Method where label data sets are choosing as real data, while target data sets are choosing as fake data. The Discriminator tries to measure the perfection of domain adaptation through loss function. Through the generator, target data sets try to adapt the source project domain and, finally, apply machine learning classifier (i.e., Naive Bayes) to classify faulty modules. Results: Our result shows that it is possible to predict defects based on the Generative Adversarial Method. Our model performs quite well in a cross-project environment when we choose JDT as a target data sets. However, all chosen data sets are facing a large class imbalance problem which affects the performance of our model.
Motivation & Objective
- Address the challenge of data distribution divergence between source and target projects in cross-project defect prediction (CPDP).
- Reduce performance degradation in CPDP caused by domain shift between projects with different software metrics distributions.
- Leverage generative adversarial networks (GANs) for unsupervised domain adaptation to align target project data with the source project’s feature space.
- Improve fault prediction accuracy in early software development stages where historical data is scarce.
- Evaluate the effectiveness of GAN-based data transformation on real-world Eclipse open-source projects using F1-measure as the primary metric.
Proposed method
- Treat labeled source project data as real data and unlabeled target project data as noise (fake) in a GAN framework.
- Train a generator network to map target project features to a distribution that mimics the source project’s feature distribution.
- Train a discriminator network to distinguish between real source data and generated (fake) target data, using a min-max loss function.
- Use the standard GAN objective function: $\min_G \max_D V(D,G) = \mathbb{E}_{x\sim p_s(x)}[\log D(x)] + \mathbb{E}_{z\sim p_t(z)}[\log(1 - D(G(z)))]$.
- Apply fully connected neural networks with ReLU activation for all layers except the output layer of the discriminator, which uses sigmoid.
- Train a Naive Bayes classifier on the original labeled source data and apply it to the generated (domain-adapted) target data for final fault classification.
Experimental results
Research questions
- RQ1Can a GAN-based domain adaptation method effectively reduce data distribution divergence between source and target projects in CPDP?
- RQ2How does the performance of the proposed model vary with different numbers of training epochs in terms of F1-measure?
- RQ3Does the model achieve better performance when predicting faults in projects with more similar codebase characteristics (e.g., JDT vs. lucene) compared to the source project?
- RQ4To what extent does class imbalance in target datasets affect the model’s predictive performance?
Key findings
- The GAN-based domain adaptation method successfully reduces data distribution divergence between source and target projects, improving cross-project fault prediction performance.
- The model achieves the highest F1-measure when JDT is used as the target project, indicating better alignment and transferability compared to lucene.
- Performance remains relatively stable across increasing numbers of training epochs (25 to 100), suggesting convergence and robustness to overfitting in the training process.
- The model shows significant performance degradation on the lucene dataset due to its high class imbalance (only 9.26% buggy modules), indicating a critical limitation.
- Despite the use of domain adaptation, the class imbalance problem in target datasets remains a major obstacle to achieving high F1-measure, especially in low-buggy-rate projects.
- The Naive Bayes classifier achieves reliable fault classification on the adapted target data, validating the effectiveness of the GAN-based feature space alignment.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.