Work

Error-type metrics in risk categorisation software fault prediction through integration of formal methods and machine learning

Year: 2025
Type: dissertation
Abstract: Context: Software Fault Prediction (SFP) is crucial for ensuring software quality and optimising resources. However, current SFP methods often rely on simplistic binary classifications, overlooking the complexity and diversity of faults. This study aims to enhance SFP accuracy and utility by focusing on detailed, project-specific fault analysis, particularly considering fault types and quantities. Objectives: This research aims to: 1) model Java Runtime Errors (JREs) using Stream X-Machine (SXM), termed Error Specification Machines (ESMs); 2) generate and quantify JRE test cases from ESMs as ESM values; 3) integrate ESM values with conventional software metrics to improve machine learning algorithms for error-type proneness prediction; and 4) utilise ESM values as Error-type Metrics in a novel risk categorisation strategy for SFP.Methods: The T-SXM tool, based on SXM principles, models JREs as ESMs for test case generation. It extracts ESM values, representing error prevalence, via the Program Structure Interface, focusing on four JREs: Arithmetic Exception, Null Pointer Exception, Class Cast Exception, and Index Out Of Bounds Exception. These values, integrated with conventional software metrics, are used to train diverse machine learning models - Support Vector Machine (SVM), Decision Tree (DT), Random Forest (RF), Logistic Regression (LR), Naïve Bayes (NB), Multilayer Perceptron (MLP), and Extreme Gradient Boosting (XGB). Additionally, ESM values are leveraged as Error-type Metrics. A novel risk categorisation strategy is introduced, aiming to optimise testing resource distribution. Results: The research produced three main findings. First, integrating individual ESM values with conventional software metrics improved fault prediction performance across multiple models, with LR achieving an F1-Score of 0.9836 and an MCC of 0.9419. Second, conceptualising ESM values as Error-type Metrics and applying them to the JUnit project of the BugHunter dataset yielded notable gains for LR, which attained F1-Scores of 0.795 and 0.781 in different feature-selection scenarios. Third, extending Error-type Metrics to risk-level categorisation across multiple projects demonstrated that XGB significantly outperformed competing methods. For instance, on the OrientDB and Elastic Search datasets, XGB achieved F1-Scores of 0.974 and 0.947, alongside MCC values of 0.961 and 0.923, exceeding the results of both RF and SVM. These gains were more pronounced in larger datasets, suggesting that Error-type Metrics may offer greater predictive benefits when more training data is available. Conclusion: This research integrates formal methods, software analytics, and machine learning to advance SFP. The proposed approach unifies fault modelling, prediction, and risk management, aiming to enhance predictive accuracy, enable precise fault analysis, and optimise resource allocation in software development projects.
Author: Phung, Khoa
Language: English
Open Access status: green
OpenAlex ID: W7204313365
Cites: 233
Cited by:
Related to: 10