Abstract:In software defect prediction, cross-project defect prediction is based on the labeled data from a source project to train a model and predict defects in the target project currently under development. However, the distribution differences between data from two different projects often limit the ability of cross-project defect prediction models. As the data from the source domain and target domain typically come from different distributions, existing methods mainly focus on adapting cross-domain marginal or conditional distributions. In practical application, existing methods are unable to quantitatively evaluate the importance of marginal and conditional distributions, which leads to suboptimal transfer performance. This paper proposes a cross-project defect prediction method based on a dynamic distribution adaptation network to address the distribution difference issue, utilizing transfer learning to quantitatively evaluate the relative importance of each distribution. The paper conducts experiments on 24 projects from 3 public datasets to validate the proposed method. The results show that, on average, the proposed method outperforms all baseline methods by at least 1.3% and 5.7% in terms of AUC and F1 scores, respectively. This indicates that the proposed method exhibits good performance characteristics.