一种基于领域适配的跨项目软件缺陷预测方法
作者:
作者简介:

陈曙(1981-),男,湖北武汉人,博士,讲师,CCF专业会员,主要研究领域为软件工程,需求工程,软件缺陷预测;刘童(1991-),女,硕士,主要研究领域为软件工程,软件缺陷预测;叶俊民(1965-),男,博士,教授,CCF高级会员,主要研究领域为软件工程,可信软件工程,软件缺陷定位.

通讯作者:

陈曙,E-mail:chenshu@mail.ccnu.edu.cn

中图分类号:

TP311

基金项目:

国家科技支撑计划(2015BAK33B00)


Domain Adaptation Approach for Cross-project Software Defect Prediction
Author:
Fund Project:

National Key Technology Research and Development Program of China (2015BAK33B00)

  • 摘要
  • | |
  • 访问统计
  • |
  • 参考文献 [48]
  • |
  • 相似文献 [20]
  • | | |
  • 文章评论
    摘要:

    软件缺陷预测旨在帮助软件开发人员在早期发现和定位软件部件可能存在的潜在缺陷,以达到优化测试资源分配和提高软件产品质量的目的.跨项目缺陷预测在已有项目的缺陷数据集上训练模型,去预测新的项目中的缺陷,但其效果往往不理想,其主要原因在于,采样自不同项目的样本数据集,其概率分布特性存在较大差异,由此对预测精度造成较大影响.针对此问题,提出一种监督型领域适配(domain adaptation)的跨项目软件缺陷预测方法.将实例加权的领域适配与机器学习的预测模型训练过程相结合,通过构造目标项目样本相关的权重,将其施加于充足的源项目样本中,以实例权重去影响预测模型的参数学习过程,将来自目标项目中缺陷数据集的分布特性适配到训练数据集中,从而实现缺陷数据样本的复用和跨项目软件缺陷预测.在10个大型开源软件项目上对该方法进行实证,从数据集、数据预处理、实验结果多个角度针对不同的实验设定策略进行分析;从数据、预测模型以及模型适配层面分析预测模型的过拟合问题.实验结果表明,该方法性能优于同类方法,显著优于基准性能,且能够接近和达到项目内缺陷预测的性能.

    Abstract:

    Software defect prediction aims at the very early step of software quality control, helps software engineers focus their attention on defect-prone parts during verification process. Cross-project defect predictions are proposed in which prediction models are trained by using sufficient training data from already existed software projects and predict defect in some other projects, however, their performances are always poor. The main reason is that, the divergence of the data distribution among different software projects causes a dramatic impact on the prediction accuracy. This study proposed an approach of cross-project defect prediction by applying a supervised domain adaptation based on instance weighting. The sufficient instances drawn from some source project are weighted by assigning target-dependent weights to the loss function of the prediction model when minimizing the expected loss over the distribution of source data, so that the distribution properties of the data from target project can be matched to the source project. Experiments including dataset selection, data preprocessing and results are described over different experiment strategies on ten open-source software projects. Over fitting problems are also studied through different levels including dataset, prediction model and domain adaptation process. The results show that the proposed approach is close to the performance of within-project defect prediction, better than similar approach and significantly better that of the baseline.

    参考文献
    [1] Hassan AE. Predicting faults using the complexity of code changes. In:Proc. of the Int'l Conf. on Software Engineering. 2009. 78-88.[doi:10.1109/ICSE.2009.5070510]
    [2] Kim S, Whitehead EJ, Jr Zhang Y. Classifying software changes:Clean or buggy. IEEE Trans. on Software Engineering, 2008, 34(2):181-196.[doi:10.1109/TSE.2007.70773]
    [3] Menzies T, Greenwald J, Frank A. Data mining static code attributes to learn defect predictors. IEEE Trans. on Software Engineering, 2007,33(1):2-13.[doi:10.1109/TSE.2007.256941]
    [4] Zimmermann T, Nagappan N. Predicting defects using network analysis on dependency graphs. In:Proc. of the Int'l Conf. on Software Engineering. 2008. 531-540.[doi:10.1145/1368088.1368161]
    [5] Nagappan N, Ball T, Zeller A. Mining metrics to predict component failure. In:Proc. of the Int'l Conf. on Software Engineering. 2006. 452-461.[doi:10.1145/1134285.1134349]
    [6] Chen X, Gu Q, Liu WS, Liu SL, Ni C. Software defect prediction. Ruan Jian Xue Bao/Journal of Software, 2016,27(1):1-25(in Chinese with English abstract). http://www.jos.org.cn/1000-9825/4923.htm[doi:10.13328/j.cnki.jos.004923]
    [7] Moser R, Pedrycz W, Succi G. A comparative analysis of the efficiency of change metrics and static code attributes for defect prediction. In:Proc. of the ICSE. 2008. 181-190.[doi:10.1145/1368088.1368114]
    [8] Wu R, Zhang H, Kim S, Cheung S. Relink:Recovering links between bugs and changes. In:Proc. of the Joint Meeting of the European Software Engineering Conf. and the Symp. on the Foundations of Software Engineering. 2011. 15-25.[doi:10.1145/2025113.2025120]
    [9] Lee T, Nam J, Han D, Kim S, Hoh IP. Micro interaction metrics for defect prediction. In:Proc. of the Joint Meeting of the European Software Engineering Conf. and the Symp. on the Foundations of Software Engineering. 2011. 311-321.[doi:10.1145/2025113.2025156]
    [10] Rahman F, Posnett D, Devanbu P. Recalling the imprecision of cross-project defect prediction. In:Proc. of the Int'l Symp. on the Foundations of Software Engineering. 2012. 1-11.[doi:10.1145/2393596.2393669]
    [11] Zimmermann T, Nagappan N, Gall H, Giger E, Murphy B. Cross-project defect prediction:A large scale experiment on data vs domain vs process. In:Proc. of the Joint Meeting of the European Software Engineering Conf. and the Symp. on the Foundations of Software Engineering. 2009. 91-100.[doi:10.1145/1595696.1595713]
    [12] Turhan B, Menzies T, Bener AB, Di Stefano J. On the relativevalue of cross-company and within-company data for defect prediction. Empirical Software Engineering, 2009,14(5):540-578.[doi:10.1007/s10664-008-9103-7]
    [13] Chen X, Wang LP, Gu Q, Wang Z, Ni C, Liu WS, Wang QP. A survey on cross-project software defect prediction methods. Journal of Chinese Computers, 2018,41(1):254-274(in Chinese with English abstract).
    [14] Daume III H, Marcu D. Domain adaptation for statistical classifiers. Journal off Artificial Intelligence Research, 2006,26(1):101-126.
    [15] Zhuang FZ, Luo P, He Q, Shi ZZ. Survey on transfer learning research. Ruan Jian Xue Bao/Journal of Software, 2015,26(1):26-39(in Chinese with English abstract). http://www.jos.org.cn/1000-9825/4631.htm[doi:10.13328/j.cnki.jos.004631]
    [16] Nam J, Pan SJ, Kim S. Transfer defect learning. In:Proc. of the Int'l Conf. on Software Engineering. 2013. 382-391.[doi:10. 1109/ICSE.2013.6606584]
    [17] Ma Y, Luo G, Zeng X, et al. Transfer learning for cross-company software defect prediction. Information & Software Technology, 2012,54(3):248-256.[doi:10.1016/j.infsof.2011.09.007]
    [18] He JY, Meng ZP, Chen X, Wang Z, Fan XY. Semi-supervised ensemble learning approach for cross-project defect prediction. Ruan Jian Xue Bao/Journal of Software, 2017,28(6):1455-1473(in Chinese with English abstract). http://www.jos.org.cn/1000-9825/5228.htm[doi:10.13328/j.cnki.jos.005228]
    [19] Rahman F, Devanbu P. How, and why, process metrics are better. In:Proc. of the Int'l Conf. on Software Engineering. 2013. 432-441.[doi:10.1109/ICSE.2013.6606589]
    [20] Pan SJ, Yang Q. A survey on transfer learning. IEEE Trans. on Knowledge and Data Engineering, 2010,22(10):1345-1359.[doi:10. 1109/TKDE.2009.191]
    [21] Dai W, Xue GR, Yang Q, Yu Y. Transferring naive Bayes classifiers for text classification. In:Proc. of the Association for the Advance of Artificial Intelligence, Vol.1. 2007. 540-545.
    [22] Jiang J, Zhai C. Instance weighting for domain adaptation in NLP. In:Proc. of the Annual Meeting on the Association for Computational Linguistics. 2007. 264-271.
    [23] Pan SJ, Kwok JT, Yang Q. Transfer learning via dimensionality reduction. In:Proc. of the Association for the Advance of Artificial Intelligence. 2008. 677-682.
    [24] Dai W, Yang Q, Xue GR, Yu Y. Boosting for transfer learning. In:Proc. of the Int'l Conf. on Machine Learning. 2007. 193-200.[doi:10.1145/1273496.1273521]
    [25] Bickel S, Brückner M, Scheffer T. Discriminative learning for differing training and test distributions. In:Proc. of the Int'l Conf. on Machine Learning. 2007. 81-88.[doi:10.1145/1273496.1273507]
    [26] Wachinger C, Reute M. Domain adaptation for Alzheimer's disease diagnostics. Journal of NeuroImage, 2016,139:470-479.[doi:10.1016/j.neuroimage.2016.05.053]
    [27] Japkowicz N, Stephen S. The class imbalance problem:A systematic study. Intelligent Data Analysis, 2002,6(5):429-449.
    [28] Shimodaira H. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of Statistical Planning and Inference, 2000,90(2):227-244.[doi:10.1016/S0378-3758(00)00115-4]
    [29] Goeman JJ. L1 penalized estimation in the Cox proportional hazards model. Biometrical Journal, 2010,52(1):70-84.[doi:10.1002/bimj.200900028]
    [30] Zou H, Hastie T. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society, 2005,67(2):301-320.[doi:10.1111/j.1467-9868.2005.00503.x]
    [31] Blei DM, Ng AY, Jordan MI. Latent dirichlet allocation. Journal of Machine Learning Research, 2003,3(1):993-1022.
    [32] Scott DW. Multivariate density estimation and visualization. In:Handbook of Computational Statistics. 2011. 549-569.[doi:10. 1007/978-3-642-21551-3_19]
    [33] Silverman BW. Density estimation for statistics and data analysis. In:Monographs on Statistics and Applied Probability. London:Chapman & Hall, 1986.
    [34] D'Ambros M, Lanza M, Robbes R. An extensive comparison of bug prediction approaches. In:Proc. of the Working Conf. on Mining Software Repositories. 2010. 31-41.[doi:10.1109/MSR.2010.5463279]
    [35] Kamei Y, Shihab E, Adams B, Hassan AE, Mockus A, Sinha A, Ubayashi N. A large-scale empirical study of just-in-time quality assurance. IEEE Trans. on Software Engineering, 2013,39(6):757-773.[doi:10.1109/TSE.2012.70]
    [36] Schulte L, Sajnani H. Active files as a measure of software maintainability. In:Proc. of the Int'l Conf. on Software Engineering. 2014. 4-43.[doi:10.1145/2591062.2591176]
    [37] Nagappan N, Ball T. Use of relative code churn measures to predict system defect density. In:Proc. of the Int'l Conf. on Software Engineering. 2005. 15-21.[doi:10.1109/ICSE.2005.1553571]
    [38] He H, Garcia EA. Learning from imbalanced data. IEEE Trans. on Knowledge and Data Engineering, 2009,21(9):1263-1284.[doi:10.1109/TKDE.2008.239]
    [39] Schneeweiss H, Mathes H. Factor analysis and principal components. Journal of Multivariate Analysis, 1995,55(1):105-124.[doi:10.1006/jmva.1995.1069]
    [40] Fan RE, Chang KW, Hsieh CJ, Wang XR, Lin CJ. LIBLINEAR:A library for large linear classification. Journal of Machine Learning Research, 2008,9(9):1871-1874. http://www.csie.ntu.edu.tw/~cjlin/liblinear
    [41] Wilcoxon F. Individual comparisons by ranking methods. Biometrics Bulletin, 1945,1(6):80-83.[doi:10.1007/978-1-4612-4380-9_16]
    [42] Kamei Y, Monden A, Matsumoto S, Kakimoto T, Matsumoto K. The effects of over and under sampling on fault-prone module detection. In:Proc. of the Int'l Symp. on Empirical Software Engineering and Measurement. 2007. 20-21.[doi:10.1109/ESEM. 2007.28]
    [43] Guyon I, Elisseeff A. An introduction to variable and feature selection. The Journal of Machine Learning Research, 2003,3(1):1157-1182.
    附中文参考文献:
    [6] 陈翔,顾庆,刘望舒,刘树龙,倪超.静态软件缺陷预测方法研究.软件学报,2016,27(1):1-25. http://www.jos.org.cn/1000-9825/4923.htm[doi:10.13328/j.cnki.jos.004923]
    [13] 陈翔,王莉萍,顾庆,王赞,倪超,刘望舒,王秋萍.跨项目软件缺陷预测方法研究综述.计算机学报,2018,41(1):254-274.
    [15] 庄福振,罗平,何清,史忠植.迁移学习研究进展.软件学报,2015,26(1):26-39. http://www.jos.org.cn/1000-9825/4631.htm[doi:10. 13328/j.cnki.jos.004631]
    [18] 何吉元,孟昭鹏,陈翔,王赞,樊向宇.一种半监督集成跨项目软件缺陷预测方法.软件学报,2017,28(6):1455-1473. http://www.jos.org.cn/1000-9825/5228.htm[doi:10.13328/j.cnki.jos.005228]
    引证文献
    网友评论
    网友评论
    分享到微博
    发 布
引用本文

陈曙,叶俊民,刘童.一种基于领域适配的跨项目软件缺陷预测方法.软件学报,2020,31(2):266-281

复制
分享
文章指标
  • 点击次数:2263
  • 下载次数: 4911
  • HTML阅读次数: 1922
  • 引用次数: 0
历史
  • 收稿日期:2017-12-17
  • 最后修改日期:2018-04-12
  • 在线发布日期: 2020-02-17
  • 出版日期: 2020-02-06
文章二维码
您是第19791708位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号