MCOT-KB: Multi-source cross-project defect prediction with optimal transport domain adaptation and KMMBagging
摘要
Software defect prediction (SDP) minimizes testing costs by early defect identification. However, new software projects often lack sufficient labeled defect data, posing a challenge for SDP models. Cross-Project Defect Prediction (CPDP) overcomes this challenge by leveraging labeled data from source projects to predict defects in target projects. Nonetheless, CPDP encounters key challenges, including domain distribution differences and data imbalance. Traditional distribution difference metrics used in CPDP fail to maintain geometric properties and perform well only when domain overlaps are not significant. Additionally, most existing approaches tackle distribution differences from a singular perspective. This paper introduces MCOT-KB, a novel multi-source cross-project defect prediction method comprising three key steps. First, MCOT-KB employs optimal transport domain adaptation (OTDA) with the earth mover distance (EMD) for feature-level domain adaptation, effectively mitigating distribution discrepancies, even in cases with insignificant domain overlaps. Second, MCOT-KB incorporates a two-phase resampling approach that addresses data imbalance and noise reduction through neighbor cleaning rules and SPY resampling technique. In the final step, MCOT-KB proposes KMMBagging, an ensemble method that combines kernel mean matching (KMM) weighting using the maximum mean discrepancy (MMD) metric with a Bagging classifier. This approach reduces distribution discrepancies at the instance level and delivers accurate predictions through ensemble learning. We evaluated MCOT-KB on 20 widely used public defect datasets, comparing it to various CPDP methods using different standard evaluation measures and statistical tests. The results consistently demonstrated MCOT-KB’s superior performance compared to benchmark CPDP approaches, underscoring its effectiveness in addressing the challenges of cross-project defect prediction.