Cross-project defect prediction (CPDP) is a significant solution in software defect prediction (SDP) when historical data is unavailable. In CPDP, the defect data of another project (called the source project) is used to train the model. Different training and test projects may have different feature distributions. Divergence in data distribution between source and target projects adversely affects prediction performance, and the semantic information of the tokens cannot be captured adequately. However, most of the existing deep learning approaches assume that these two projects have a uniform distribution, so the features extracted from these deep learning models are not optimal. Moreover, these approaches neglected the information about the class to which the sample belonged and were unable to discriminate the samples according to the class information. To address this issue, we proposed a framework, TC3, that exploits the combination of contrastive and transfer learning integrated with the CNN-CodeBERT model to learn class-discriminative information and obtain more transferable features for the target project. The proposed model was evaluated on PROMISE datasets. The proposed model achieved an absolute F1-score improvement of 0.047 to 0.107, corresponding to a relative improvement of 7.89% to 19.96%, and an absolute AUC improvement of 0.014 to 0.148, corresponding to a relative improvement of 2.18% to 29.19% as compared to the baseline methods.
No takes yet. Share an insight, caveat, or question.
Sahar et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: