Evaluating the effectiveness of decomposed Halstead Metrics in software fault prediction
PeerJ Computer Science · 27.11.2023 · 9 · e1647
DOI: 10.7717/peerj-cs.1647 ↗Kurz gefasst
Fachartikel in der Zeitschrift PeerJ Computer Science, online erschienen am 27.11.2023. Verfasst von Bilal Khan und 1 weiteren Autor:innen. Beteiligte Einrichtung: Capital University of Science & Technology, Islamabad, Pakistan. Die Arbeit wurde bisher 16-mal zitiert (Crossref) und nennt 57 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).
Abstract (Originalsprache)
The occurrence of faults in software systems represents an inevitable predicament. Testing is the most common means to detect such faults; however, exhaustive testing is not feasible for any nontrivial system. Software fault prediction (SFP), which identifies software components that are more prone to errors, seeks to supplement the testing process. Thus, testing efforts can be focused on such modules. Various approaches exist for SFP, with machine learning (ML) emerging as the prevailing methodology. ML-based SFP relies on a wide range of metrics, ranging from file-level and class-level to method-level and even line-level metrics. More granularized metrics are expected to possess a higher degree of micro-level coverage of the code. The Halstead metric suite offers coverage at the line level and has been extensively employed across diverse domains such as fault prediction, quality assessment, and similarity approximation for the past three decades. In this article, we propose to decompose Halstead base metrics and evaluate their fault prediction capability. The Halstead base metrics consist of operators and operands. In the context of the Java language, we partition operators into five distinct categories, i.e. , assignment operators, arithmetic operators, logical operators, relational operators, and all other types of operators. Similarly, operands are classified into two classes: constants and variables. For the purpose of empirical evaluation, two experiments were designed. In the first experiment, the Halstead base metrics were used along with McCabe, Lines of Code (LoC), and Halstead-derived metrics as predictors. In the second experiment, decomposed Halstead base metrics were used along with McCabe, LoC, and Halstead-derived metrics. Five public datasets were selected for the experiments. The ML classifiers used included logistic regression, naïve Bayes, decision tree, multilayer perceptron, random forest, and support vector machines. The ML classifiers’ effectiveness was assessed through metrics such as accuracy, F-measure, and AUC. Accuracy saw an enhancement from 0.82 to 0.97, while F-measure exhibited improvement from 0.81 to 0.99. Correspondingly, the AUC value advanced from 0.79 to 0.99. These findings highlight the superior performance of decomposed Halstead metrics, as opposed to the original Halstead base metrics, in predicting faults across all datasets.
Schlagwörter
Stichwörter der Autor:innen
Autor:innen und Institutionen
- Capital University of Science & Technology, Islamabad, Pakistan.
Zitieren
APA
Khan, B., & Nadeem, A. (2023). Evaluating the effectiveness of decomposed Halstead Metrics in software fault prediction. PeerJ Computer Science, 9, e1647. https://doi.org/10.7717/peerj-cs.1647
Vancouver
Khan B, Nadeem A. Evaluating the effectiveness of decomposed Halstead Metrics in software fault prediction. PeerJ Computer Science. 2023;9:e1647. doi:10.7717/peerj-cs.1647
BibTeX
@article{Khan2023,
author = {Khan, Bilal and Nadeem, Aamer},
title = {Evaluating the effectiveness of decomposed Halstead Metrics in software fault prediction},
journal = {PeerJ Computer Science},
year = {2023},
volume = {9},
pages = {e1647},
doi = {10.7717/peerj-cs.1647}
}
EUVIMED