Skip to main content
Log in

A Cluster Based Feature Selection Method for Cross-Project Software Defect Prediction

  • Regular Paper
  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

Abstract

Cross-project defect prediction (CPDP) uses the labeled data from external source software projects to compensate the shortage of useful data in the target project, in order to build a meaningful classification model. However, the distribution gap between software features extracted from the source and the target projects may be too large to make the mixed data useful for training. In this paper, we propose a cluster-based novel method FeSCH (Feature Selection Using Clusters of Hybrid-Data) to alleviate the distribution differences by feature selection. FeSCH includes two phases. The feature clustering phase clusters features using a density-based clustering method, and the feature selection phase selects features from each cluster using a ranking strategy. For CPDP, we design three different heuristic ranking strategies in the second phase. To investigate the prediction performance of FeSCH, we design experiments based on real-world software projects, and study the effects of design options in FeSCH (such as ranking strategy, feature selection ratio, and classifiers). The experimental results prove the effectiveness of FeSCH. Firstly, compared with the state-of-the-art baseline methods, FeSCH achieves better performance and its performance is less affected by the classifiers used. Secondly, FeSCH enhances the performance by effectively selecting features across feature categories, and provides guidelines for selecting useful features for defect prediction.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Nam J, Pan S J, Kim S. Transfer defect learning. In Proc. the 35th Int. Conf. Software Engineering, May 2013, pp.382-391.

  2. Zhang F, Keivanloo I, Zou Y. Data transformation in cross-project defect prediction. Empir. Softw. Eng., 2017, 22(6): 3186-3218.

    Article  Google Scholar 

  3. Herbold S. Training data selection for cross-project defect prediction. In Proc. the 9th Int. Conf. Predictive Models in Software Engineering, October 2013, Article No. 6.

  4. Turhan B, Menzies T, Bener A B, Di Stefano J. On the relative value of cross-company and within-company data for defect prediction. Empir. Softw. Eng., 2009, 14(5): 540-578.

    Article  Google Scholar 

  5. Peters F, Menzies T, Marcus A. Better cross company defect prediction. In Proc. the 10th Working Conf. Mining Software Repositories, May 2013, pp.409-418.

  6. Amasaki S, Kawata K, Yokogawa T. Improving cross-project defect prediction methods with data simplification. In Proc. the 41st Euromicro Conf. Software Engineering and Advanced Applications, August 2015, pp.96-103.

  7. Rodriguez A, Laio A. Clustering by fast search and find of density peaks. Science, 2014, 344(6191): 1492-1496.

    Article  Google Scholar 

  8. Briand L C, Melo W L, Wust J. Assessing the applicability of fault-proneness models across object-oriented software projects. IEEE Trans. Softw. Eng., 2002, 28(7): 706-720.

    Article  Google Scholar 

  9. 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. the 7th Joint Meeting of the European Software Engineering Conf. and the ACM SIGSOFT Symp. the Foundations of Software Engineering, August 2009, pp.91-100.

  10. He Z M, Shu F D, Yang Y, Li M S, Wang Q. An investigation on the feasibility of cross-project defect prediction. Autom. Softw. Eng., 2012, 19(2): 167-199.

    Article  Google Scholar 

  11. Ma Y, Luo G C, Zeng X, Chen A G. Transfer learning for cross-company software defect prediction. Inf. Softw. Technol., 2012, 54(3): 248-256.

    Article  Google Scholar 

  12. Ryu D, Jang J I, Baik J. A hybrid instance selection using nearest-neighbor for cross-project defect prediction. J. Comput. Sci. Technol., 2015, 30(5): 969-980.

    Article  Google Scholar 

  13. Herbold S, Trautsch A, Grabowski J. Global vs. local models for cross-project defect prediction. Empir. Softw. Eng., 2017, 22(4): 1866-1902.

  14. Wang S, Liu T Y, Tan L. Automatically learning semantic features for defect prediction. In Proc. the 38th Int. Conf. Software Engineering, May 2016, pp.297-308.

  15. Chen L, Fang B, Shang Z W, Tang Y Y. Negative samples reduction in cross-company software defects prediction. Inf. Softw. Technol., 2015, 62: 6777.

    Article  Google Scholar 

  16. Canfora G, De Lucia A, Di Penta M, Oliveto R, Panichella A, Panichella S. Multi-objective cross-project defect prediction. In Proc. the 6th Int. Conf. Software Testing Verification and Validation, March 2013, pp.252-261.

  17. Panichella A, Oliveto R, De Lucia A. Cross-project defect prediction models: L’union fait la force. In Proc. Conf. Software Maintenance Reengineering and Reverse Engineering, February 2014, pp.164-173.

  18. Zhang Y, Lo D, Xia X, Sun J L. An empirical study of classifier combination for cross-project defect prediction. In Proc. the 39th Annual Computer Software and Applications Conf., July 2015, 2: 264-269.

  19. Zhang F, Mockus A, Keivanloo I, Zou Y. Towards building a universal defect prediction model. In Proc. the 11th Working Conf. Mining Software Repositories, May 2014, pp.182-191.

  20. Xia X, Lo D, Pan S J, Nagappan N, Wang X Y. HYDRA: Massively compositional model for cross-project defect prediction. IEEE Trans. Softw. Eng., 2016, 42(10): 977-998.

    Article  Google Scholar 

  21. Herbold S. CrossPare: A tool for benchmarking cross-project defect predictions. In Proc. the 30th ACM/IEEE Int. Conf. Automated Software Engineering Workshop November 2015, pp.90-96.

  22. Nam J, Kim S. Heterogeneous defect prediction. In Proc. the 10th Joint Meeting on Foundations of Software Engineering, September 2015, pp.508-519.

  23. Jing X Y, Wu F, Dong X W, Qi F M, Xu B W. Heterogeneous cross-company defect prediction by unified metric representation and CCA-based transfer learning. In Proc. the 10th Joint Meeting on Foundations of Software Engineering, August 30-September 4, 2015, pp.496-507.

  24. Kamei Y, Fukushima T, McIntosh S, Yamashita K, Ubayashi N, Hassan A E. Studying just-in-time defect prediction using cross-project models. Empir. Softw. Eng., 2016, 21(5): 2072-2106.

    Article  Google Scholar 

  25. Hosseini S, Turhan B, Mäntylä M. Search based training data selection for cross project defect prediction. In Proc. the 12th Int. Conf. Predictive MODELS and Data Analytics in Software Engineering, September 2016, Article No. 3.

  26. Nam J, Kim S. CLAMI: Defect prediction on unlabeled datasets. In Proc. the 30th ACM/IEEE Int. Conf. Automated Software Engineering, November 2015, pp.452-463.

  27. Zhang F, Zheng Q, Zou Y, Hassan A E. Cross-project defect prediction using a connectivity-based unsupervised classifier. In Proc. the 38th Int. Conf. Software Engineering, May 2016, pp.309-320.

  28. Gao K H, Khoshgoftaar T M, Wang H J, Seliya N. Choosing software metrics for defect prediction: An investigation on feature selection techniques. Softw.: Pract. Exper., 2011, 41(5): 579-606.

    Google Scholar 

  29. Shivaji S, Whitehead E J, Akella R, Kim S. Reducing features to improve code change-based bug prediction. IEEE Trans. Softw. Eng., 2013, 39(4): 552-569.

    Article  Google Scholar 

  30. Xu Z, Liu J, Yang Z J, An G G, Jia X Y. The impact of feature selection on defect prediction performance: An empirical comparison. In Proc. the 27th IEEE Int. Symp. Software Reliability Engineering, October 2016, pp.309-320.

  31. Xu Z, Liu J, Xia Z, Yuan P P. An empirical study on the equivalence and stability of feature selection for noisy software defect data. In Proc. the 29th Int. Conf. Software Engineering and Knowledge Engineering, July 2017, pp.191-196.

  32. Ghotra B, McIntosh S, Hassan A E. A large-scale study of the impact of feature selection techniques on defect classification models. In Proc. the 14th Int. Conf. Mining Software Repositories, May 2017, pp.146-157.

  33. Liu S L, Chen X, Liu W S, Chen J Q, Gu Q, Chen D X. FECAR: A feature selection framework for software defect prediction. In Proc. the 38th Annual Computer Software and Applications Conf., July 2014, pp.426-435.

  34. LiuWS, Liu S L, Gu Q, Chen J Q, Chen X, Chen D X. Empirical studies of a two-stage data preprocessing approach for software fault prediction. IEEE Trans. Reliab., 2016, 65(1): 38-53.

  35. Liu W S, Chen X, Gu Q, Liu S L, Chen D X. A clusteranalysis-based feature-selection method for software defect prediction. Sci. Sin. Inf., 2016, 46(9): 1298-1320.

    Google Scholar 

  36. Reshef D N, Reshef Y A, Finucane H K, Grossman S R, McVean G, Turnbaugh P J, Lander E S, Mitzenmacher M, Sabeti P C. Detecting novel associations in large data sets. Science, 2011, 334(6062): 1518-1524.

    Article  MATH  Google Scholar 

  37. Fan R E, Chang K W, Hsieh C J, Wang X R, Lin C J. LIBLINEAR: A library for large linear classification. J. Mach. Learn. Res., 2008, 9: 1871-1874.

    MATH  Google Scholar 

  38. Wu R X, Zhang H Y, Kim S, Cheung S C. ReLink: Recovering links between bugs and changes. In Proc. the 19th ACM SIGSOFT Symp. and the 13th European Conf. Foundations of Software Engineering, September 2011, pp.15-25.

  39. D’Ambros M, Lanza M, Robbes R. An extensive comparison of bug prediction approaches. In Proc. the 7th IEEE Working Conf. Mining Software Repositories, May 2010, pp.31-41.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Qing Gu.

Electronic supplementary material

Below is the link to the electronic supplementary material.

ESM 1

(PDF 218 kb)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Ni, C., Liu, WS., Chen, X. et al. A Cluster Based Feature Selection Method for Cross-Project Software Defect Prediction. J. Comput. Sci. Technol. 32, 1090–1107 (2017). https://doi.org/10.1007/s11390-017-1785-0

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11390-017-1785-0

Keywords

Navigation