Skip to content
#software testing Open access

Software Defect Prediction Using Explainable Machine Learning

Nov 2026 · Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research

Abstract

However, not all the modules can be tested in the same way effectively and therefore defect prediction models are used to focus the testing efforts on the modules that are most likely to be defective. There are two major problems related to the use of defect prediction models. First, there are few defective modules, and, consequently, even a very accurate model may find no defects at all. Second, an unspecific model, i.e. the one that gives no justification for its prediction, is difficult to be trusted by developers. In this paper, Logistic Regression and Random Forest models are trained on a NASA-like dataset containing around 2,100 modules and 21 code metrics, of which only around 15 percent are defective. Then each of the two models is used in three versions: with all the features (as a baseline), with feature selection and SMOTE oversampling. Next, SHAP approach is used to explain the influence of different metrics on defect prediction. The three models without SMOTE showed an accuracy ranging from 0.84 to 0.86, which is equal to the accuracy that could be reached by the model predicting non-defective status for all the modules and recall ranging from 0.19 to 0.31. SMOTE improved the recall of Logistic Regression from 0.21 to 0.71 and of Random Forest from 0.31 to 0.47, at the expense of lower precision and, in case of Logistic Regression, also accuracy of 0.73. SMOTE resulted in the highest F1 scores (0.45 and 0.44). Feature selection did not improve anything. According to SHAP analysis, total operators, Halstead difficulty, cyclomatic complexity and lines of code were the most significant metrics. Several size and volume metrics had contradictory effect on prediction because of their high correlation. The obtained results allow the comparison of the approaches on the basis of one dataset but are not indicative of the software projects.

View source

Similar papers

#computer vision Review Sep 2017

Agile Software Development Methods: Review and Analysis

This publication proposes a definition and a classification of agile software development approaches and analyses ten software development methods that can be characterized as being "agile" against the defined criterion.

P. Abrahamsson, O. Salo, Jussi Ronkainen et al. · 727 citations · ⚡54
#computer vision Jun 2008

The impact of agile practices on communication in software development

The study shows that agile practices improve both informal and formal communication, but indicates that, in larger development situations involving multiple external stakeholders, a mismatch of adequate communication mechanisms can sometimes even hinder the communication.

M. Pikkarainen, Jukka Haikara, O. Salo et al. · 401 citations · ⚡48
#machine learning Review Open access Oct 2014

Software development in startup companies: A systematic mapping study

The results indicate that software engineering work practices are chosen opportunistically, adapted and configured to provide value under the constrains imposed by the startup context.

Nicolò Paternoster, Carmine Giardino, M. Unterkalmsteiner et al. · 394 citations · ⚡54
#computer vision Review Mar 2008

Agile methods in European embedded software development organisations: a survey on the actual use and usefulness of Extreme Programming and Scrum

The results show that the embedded industry has been able to apply agile methods in its development processes and that the appreciation of the agile methods and their individual practices appears to increase once adopted and applied in practice.

O. Salo, P. Abrahamsson · 238 citations · ⚡9
#computer vision Open access Jul 2017

What happens when software developers are (un)happy

Consequences of happiness and unhappiness that are beneficial and detrimental for developers' mental well-being, the software development process, and the produced artifacts are found.

D. Graziotin, Fabian Fagerholm, Xiaofeng Wang et al. · 236 citations · ⚡13
#computer vision Open access Oct 2004

Mobile-D: an agile approach for mobile application development

The Mobile-D approach is briefly outlined here and the experiences gained from four case studies are discussed, which helped develop an agile development approach for mobile application development.

P. Abrahamsson, Antti Hanhineva, H. Hulkko et al. · 225 citations · ⚡18

Related blog posts

Microsoft Research Blog Nov 12, 2026

Microsoft Research Focus – Edition #98

What's new in research at Microsoft? Host Anson Ho explores the latest, including AI-powered universal translation, a breakthrough in a 31-year-old mathematics challenge, and advances making AI coding agents faster and more efficient.  The post Microsoft Research Focus – Edition #98 appeared first on Microsoft Research.

Microsoft Research Blog Nov 5, 2026

Formally verifying agent-written full-stack web apps with PDD Kit

AI agents can generate code at a scale that’s hard for humans to review line-by-line. PDD Kit helps ensure the code is doing what the developer intended by creating formal specifications and testing against them. It converts developer intent into a Verus specification, proves AI-generated code meets it for every input, and uses tests where proofs aren't practical. Developers review intent, not every line. The post Formally verifying agent-written full-stack web apps with PDD Kit appeared first o…

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