Skip to main content
QUICK REVIEW

[论文解读] Generative Adversarial Network-based Cross-Project Fault Prediction

Sourabh Pal|arXiv (Cornell University)|May 15, 2021
Software Engineering Research参考文献 30被引用 5
一句话总结

本文提出了一种基于生成对抗网络(GAN)的跨项目软件缺陷预测(CPDP)领域自适应方法,其中生成器将目标项目数据转换为与源项目分布一致,从而减少数据差异。该方法在F1-measure指标上表现优异,尤其在JDT作为目标项目时效果显著,但类别不平衡仍是主要挑战。

ABSTRACT

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.

研究动机与目标

  • 解决跨项目缺陷预测(CPDP)中源项目与目标项目之间数据分布差异的问题。
  • 减轻由于项目间软件度量分布差异导致的领域偏移所引起的性能下降。
  • 利用生成对抗网络(GANs)进行无监督领域自适应,将目标项目数据与源项目的特征空间对齐。
  • 在历史数据稀缺的早期软件开发阶段,提升缺陷预测的准确性。
  • 使用F1-measure作为主要指标,评估GAN-based数据转换在真实世界Eclipse开源项目上的有效性。

提出的方法

  • 在GAN框架中,将带标签的源项目数据视为真实数据,将无标签的目标项目数据视为噪声(假数据)。
  • 训练一个生成器网络,将目标项目的特征映射到与源项目特征分布相似的分布。
  • 训练一个判别器网络,以区分真实源数据与生成的(假)目标数据,使用最小最大损失函数。
  • 采用标准GAN目标函数:$\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)))]$。
  • 所有层均使用全连接神经网络与ReLU激活函数,判别器输出层除外,其使用Sigmoid激活函数。
  • 在原始带标签的源项目数据上训练朴素贝叶斯分类器,并将其应用于生成的(领域自适应后的)目标数据,以完成最终的缺陷分类。

实验结果

研究问题

  • RQ1基于GAN的领域自适应方法能否有效减少CPDP中源项目与目标项目之间的数据分布差异?
  • RQ2在不同训练轮次数量下,所提出模型的F1-measure表现如何变化?
  • RQ3当目标项目与源项目具有更相似的代码库特征时(例如JDT与lucene),模型是否表现出更好的性能?
  • RQ4目标数据集中的类别不平衡在多大程度上影响模型的预测性能?

主要发现

  • 基于GAN的领域自适应方法成功减少了源项目与目标项目之间的数据分布差异,提升了跨项目缺陷预测的性能。
  • 当JDT作为目标项目时,模型取得最高的F1-measure,表明其与源项目相比具有更好的对齐效果和可迁移性。
  • 随着训练轮次从25增加到100,性能保持相对稳定,表明训练过程已收敛且对过拟合具有鲁棒性。
  • 由于lucene数据集存在严重的类别不平衡(仅9.26%的缺陷模块),模型性能出现显著下降,暴露出一个关键局限性。
  • 尽管采用了领域自适应,目标数据集中的类别不平衡问题仍是实现高F1-measure的主要障碍,尤其在缺陷率较低的项目中更为明显。
  • 朴素贝叶斯分类器在经自适应处理的目标数据上实现了可靠的缺陷分类,验证了基于GAN的特征空间对齐的有效性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。