Software defect prediction using ensemble machine learning on open-source code repositories
Keywords:
Software Defect Prediction, Ensemble Learning Stacking, Random Forest, Promise Repository, CK Metrics, Software Quality Assurance.Abstract
Software defect prediction is an important software quality assurance exercise which helps the development teams to allocate the testing software resource effectively and identify the modules that are prone to the risk of fault before the software is introduced to the market. Single-classifier methods that are traditional are usually affected by the bias-variance trade-offs, and poor cross-heterogeneous-codebase generalization. This paper provides a Postulation of ensemble machine learning structure involving the incorporation of Random Forest, XGBoost, Support Vector Machine (SVM), and LightGBM to be able to be base learner in a stacking meta-ensemble architecture in order to take defect prediction of open-source software projects details. The models used in the proposed framework are based on the Chidamber-Kemerer (CK) object-oriented measures of feature engineering of six open-source projects, namely Camel, Jedit, Xerces, Ant, Log4j, and Lucene. In order to overcome the class disparity that exists in sets of defects, Synthetic Minority Oversampling Technique (SMOTE) is used during preprocessing. A logistic regression meta-learner thereof is a combination of the probability output of the four base classifiers and in this way the stacking ensemble is able to identify a wide range of decision boundaries and accurately reduce prediction error. Strategic 10-fold cross-validation experimental validation with proposed ensemble model on benchmark PROMISE and NASA MDP datasets show that the ensemble model has an accuracy of 94.3 and 93.1 as well as the recall of 92.7 and F1-score of 92.9 and an AUC-ROC of 0.97. These scores are the improvements of 3.3 to 10.6 percentages points as compared to single classifiers. The Wilcoxon signed-rank tests are found to have no statistical significance (p < 0.05). The paper also compares the cross-project transferability, ranking of the feature importance, and states that the measures of complexity and coupling are the most pertinent ones as far as detecting the defects are concerned. The results indicate that ensemble stacking is practically viable and a strengthened and broad applicability of the method in managing the quality of software on a large scale in industries.
References
T. Hall, S. Beecham, D. Bowes, D. Gray, and S. Counsell, 'A systematic literature review on fault prediction performance in software engineering', IEEE Trans. Softw. Eng., vol. 38, no. 6, pp. 1276-1304, Nov. 2012. doi.org/10.1109/TSE.2011.103
T. Menzies, J. Greenwald, and A. Frank, 'Data mining static code attributes to learn defect predictors', IEEE Trans. Softw. Eng., vol. 33, no. 1, pp. 2-13, Jan. 2007. doi.org/10.1109/TSE.2007.256941
M. D'Ambros, M. Lanza, and R. Robbes, 'Evaluating defect prediction approaches: a benchmark and an extensive comparison', Empir. Softw. Eng., vol. 17, no. 4-5, pp. 531-577, Aug. 2012 doi.org/10.1007/s10664-011-9173-9
M. A. Akbar, K. Smolander, S. Mahmood, and A. Alsanad, 'Toward successful DevSecOps in software development organizations: A decision-making framework', Inf. Softw. Technol., vol. 147, no. 106894, p. 106894, July 2022. doi.org/10.1016/j.infsof.2022.106894
T. Menzies, B. Turhan, A. Bener, G. Gay, T. Ozment, and Z. Xu, "Implications of ceiling effects in defect predictors," in Proc. 4th Int. Workshop Predictor Models Softw. Eng., Leipzig, Germany, 2008, pp. 47-54, doi.org/10.1145/1370788.1370801
L. Rokach, 'Ensemble-based classifiers', Artif. Intell. Rev., vol. 33, no. 1-2, pp. 1-39, Feb. 2010. doi.org/10.1007/s10462-009-9124-7
D. H. Wolpert, 'Stacked generalization', Neural Netw., vol. 5, no. 2, pp. 241-259, Jan. 1992. doi.org/10.1016/S0893-6080(05)80023-1
O. Picado et al., 'The role of surgical resection for stage IV gastric cancer with synchronous hepatic metastasis', J. Surg. Res., vol. 232, pp. 422-429, Dec. 2018. doi.org/10.1016/j.jss.2018.06.067
N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, 'SMOTE: Synthetic minority over-sampling technique', J. Artif. Intell. Res., vol. 16, pp. 321-357, June 2002. doi.org/10.1613/jair.953
V. R. Basili, L. C. Briand, and W. L. Melo, 'A validation of object-oriented design metrics as quality indicators', IEEE Trans. Softw. Eng., vol. 22, no. 10, pp. 751-761, Oct. 1996. doi.org/10.1109/32.544352
S. Lessmann, B. Baesens, C. Mues, and S. Pietsch, 'Benchmarking classification models for software defect prediction: A proposed framework and novel findings', IEEE Trans. Softw. Eng., vol. 34, no. 4, pp. 485-496, July 2008. doi.org/10.1109/TSE.2008.35
T. M. Khoshgoftaar and N. Seliya, "Analogy-based practical classification rules for software quality estimation," Empir. Softw. Eng., vol. 8, no. 4, pp. 325-350, 2003, doi.org/10.1023/A:1025316301168
R. Akase and Y. Okada, 'IGA-based interactive framework using conjoint analysis and SOM for designing room layout', Int. J. Softw. Eng. Knowl. Eng., vol. 25, no. 02, pp. 361-395, Mar. 2015. doi.org/10.1142/S0218194015400136
T. Chen and C. Guestrin, 'XGBoost', in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco California USA, 2016, pp. 785-794. doi.org/10.1145/2939672.2939785
J. Nam, S. J. Pan, and S. Kim, 'Transfer defect learning', in 2013 35th International Conference on Software Engineering (ICSE), San Francisco, CA, USA, 2013. doi.org/10.1109/ICSE.2013.6606584
S. Wang, T. Liu, and L. Tan, 'Automatically learning semantic features for defect prediction', in Proceedings of the 38th International Conference on Software Engineering, Austin Texas, 2016. doi.org/10.1145/2884781.2884804
J. Li, P. He, J. Zhu, and M. R. Lyu, 'Software defect prediction via convolutional neural network', in 2017 IEEE International Conference on Software Quality, Reliability and Security (QRS), Prague, Czech Republic, 2017. doi.org/10.1109/QRS.2017.42
G. Zhang, X. Peng, Z. Xing, S. Jiang, H. Wang, and W. Zhao, 'Towards contextual and on-demand code clone management by continuous monitoring', in 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE), Silicon Valley, CA, USA, 2013. doi.org/10.1109/ASE.2013.6693107
S. Hosseini, B. Turhan, and D. Gunarathna, 'A systematic literature review and meta-analysis on cross project defect prediction', IEEE Trans. Softw. Eng., vol. 45, no. 2, pp. 111-147, Feb. 2019. doi.org/10.1109/TSE.2017.2770124
M. Jureczko and L. Madeyski, 'Towards identifying software project clusters with regard to defect prediction', in Proceedings of the 6th International Conference on Predictive Models in Software Engineering, Timişoara Romania, 2010. doi.org/10.1145/1868328.1868342
T. Menzies, Z. Milton, B. Turhan, B. Cukic, Y. Jiang, and A. Bener, 'Defect prediction from static code features: current results, limitations, new approaches', Autom. Softw. Eng., vol. 17, no. 4, pp. 375-407, Dec. 2010. doi.org/10.1007/s10515-010-0069-5
S. R. Chidamber and C. F. Kemerer, 'A metrics suite for object oriented design', IEEE Trans. Softw. Eng., vol. 20, no. 6, pp. 476-493, June 1994. doi.org/10.1109/32.295895
T. J. McCabe, 'A Complexity Measure', IEEE Trans. Softw. Eng., vol. SE-2, no. 4, pp. 308-320, Dec. 1976. doi.org/10.1109/TSE.1976.233837
L. Breiman, 'Random forests', Mach. Learn., vol. 45, no. 1, pp. 5-32, Oct. 2001. doi.org/10.1023/A:1010933404324
C. Cortes and V. Vapnik, 'Support-vector networks', Mach. Learn., vol. 20, no. 3, pp. 273-297, Sept. 1995. doi.org/10.1007/BF00994018
Published
How to Cite
Issue
Section
Copyright (c) 2026 Dr. Ruwaida Mohammed Yas

This work is licensed under a Creative Commons Attribution 4.0 International License.