Abstract:Predicting defect through mining softwarerepositories(MSRs) is crucial for enhancing the security and quality of software. With an extensive collection of software defect data acquired by mining various repositories, numerous machine learning-based approaches have been proposed for defect detection. However, due to the heterogeneity of vulnerability data originating from different repositories, the robustness of the approach is significantly compromised. In light of this, a defect prediction approach was proposed, based on multi-source Domain Adaptation and Data Augmentation(DPDA).Our approach mined feature similarities between various source repositories and target repository. Specifically, it employed weighted maximum mean differences to minimize the distribution distance of their features. Meanwhile, different attention scores were assigned to weigh different sources to increase the weight of source repositories with high similarity to the target repository. This strategic weighting aims to focus on the source repository with high similarity in the model, reducing the impact of irrelevant repositories. The comparative experiments demonstrated that our approach can achieve the best performance in predicting software defect.