跨项目缺陷预测(CPDP)利用来自其他项目的缺陷数据预测目标项目的缺陷情况,为解决以往缺陷预测方法面临的训练数据受限问题提供了一个新的视角。训练数据的质量将直接影响跨项目缺陷预测模型的性能,因此,需尽可能选择与目标项目更相似的数据用于模型的训练。利用PROMISE提供的34个公开数据集,从训练数据选择方面,分析了四种典型的相似性度量方法对跨项目预测结果的影响以及各种方法之间的差异。研究结果表明:使用不同的相似性度量方法选出的训练数据质量不同,其中余弦相似性与相关系数两种方法效果更好,且最大改进比例达到6.7%;同时,根据目标项目的缺陷率,发现余弦相似性更适合于缺陷率高于0.25的项目。
Cross-Project Defect Prediction ( CPDP), which uses data from other projects to predict defects in the target project, provides a new perspective to resolve the shortcoming of limited training data encountered in traditional defect prediction. The data more similar to target project should be given priority in the context, because the quality of train cross- project data will directly affect the performance of cross-project defect prediction. In this paper, to analyze the impact of different similarity measures on the selection of training data for cross-project defect prediction, experiments were performed on 34 datasets from the PROMISE repository. The results show that the quality of training data selected by different similarity measure methods is various, and cosine similarity and correlation coefficient can achieve better performance as a whole. The greatest improvement rate is up to 6.7%. According to defect rate of target project, cosine similarity is seem to be more suitable when the defect rate is more than 0.25.