Skip to content
Open access

Integrating Explainable Artificial Intelligence into Software Defect Prediction: Addressing the Black Box Challenge

2026 · Computers, Materials & Continua · 0 citations · 67 references

Abstract

: Software Defect Prediction (SDP) plays a critical role in improving software quality by identifying fault-prone modules early in the development lifecycle. While machine learning models (particularly black-box) have demonstrated high predictive accuracy, their lack of interpretability limits their adoption in environments where transparency and trust are essential. In contrast, naturally explainable models such as Logistic Regression, Decision Trees, and Naïve Bayes offer intrinsic interpretability but may underperform in complex defect prediction tasks. This paper presents a comparative empirical evaluation of seven classification algorithms (three naturally explainable and four black-box) across five datasets from the NASA PROMISE repository. Black-box models are enhanced with post-hoc Explainable Artificial Intelligence (XAI) techniques, namely LIME, SHAP, and Breakdown. To assess the quality of the generated explanations, a set of interpretability metrics including fidelity, stability, complexity, and a composite interpretability score is proposed. Our results show that black-box models achieved superior predictive performance in one out of five datasets (JM1), while in the remaining datasets, naturally explainable models were either competitive or superior. Notably, Logistic Regression achieved the highest F1-scores in KC1, KC2, and PC1, surpassing all black-box models in those datasets, and tied with SVM in CM1. Among XAI techniques, LIME offers the most concise explanations (complexity = 0.476), while SHAP and Breakdown provide complete coverage (complexity = 1.0). Random Forest and Gradient Boosting achieve the highest composite interpretability scores (0.92), indicating reliable and consistent explanations. Our findings suggest that post-hoc XAI techniques are justified when black-box models provide clear predictive advantages, but naturally explainable models should not be overlooked, particularly when interpretability is a primary requirement.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.