arrow
Return

CoCo-GAN: CodeBERT-driven collaborative generative adversarial learning for software defect prediction

delete2026-03-19
delete0
PRE
AI
X
Xiaoxing Yang
L
Liwei Xiao
J
Jianmin Su
DOI:10.1007/s11219-026-09747-6delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Software defect prediction (SDP) is essential for improving software reliability by identifying faulty components early in the development process. However, SDP faces three major challenges: class imbalance, scarcity of labeled data, and distributional discrepancies across projects or versions. To address these challenges, we propose CoCo-GAN, a CodeBERT-based collaborative adversarial framework for SDP. CoCo-GAN consists of three main components: a bimodal CodeBERT input constructed from source code and associated comments to capture richer semantic representations; a conditional GAN (CGAN) that generates synthetic samples for the minority class, mitigating data scarcity and class imbalance; and a semi-supervised GAN (SSGAN) that leverages unlabeled data to reduce distribution gaps between source and target projects. Additionally, a block-regularized repeated half-sampling (BRHS) strategy combined with ensemble learning is employed to better utilize limited labeled data and enhance training robustness. Experiments on ten Java projects from the PROMISE benchmark show that CoCo-GAN increases the average F1 score from 51.8 and 53.4 of MFGNN and DP-CCL, respectively, to 57.8 in within-project defect prediction (WPDP), and from 43.4 and 51.0 to 53.1 in cross-project defect prediction (CPDP). This improvement arises because CoCo-GAN jointly exploits semantic-rich bimodal inputs to strengthen feature representation, uses CGAN-generated minority samples to stabilize learning under extreme imbalance, and aligns source-target domains via SSGAN's adversarial use of unlabeled data-addressing a combination of challenges that prior methods typically overlook or handle only partially.
Keywords:
Software defect prediction
Semi-supervised learning
Generative adversarial networks
Pre-trained models
Ensemble learning

Journal

S
Software Quality Journal
IF:
2.3
Papers:
30
Citations:
918

Organization

Hong Kong Chu Hai College cover
Hong Kong Chu Hai College
Scholars:
78
Papers: 83
Citations: 65
S
Shenzhen Technology University
Scholars:
3.5K
Papers: 2.3K
Citations: 4.1K
W
wuyi university
Scholars:
1.1K
Papers: 306
Citations: 0
researcher View more organizations