Applying Cost-Sensitive Learning to Mitigate the Effect of Class Imbalance for Deep Learning-Based Fault Localization
- 26 September 2026
- journal article
- research article
- Published by World Scientific Pub Co Pte Ltd in International Journal of Software Engineering and Knowledge Engineering
- p. 1-34
Abstract
Automated software fault localization has become a research focus with the growing software scale. Deep learning-based fault localization (DLFL) has been widely studied due to its excellent performance. Most existing DLFL methods use the execution traces of the test cases as features. However, the number of passing test cases is far more than that of failed test cases in the practical test suite. The severe class imbalance problem is ignored in existing DLFL methods. To alleviate the impact of the class imbalance on DLFL, we propose applying cost-sensitive learning to set different weights for each sample to optimize the performance of fault localization. We reduce the number of passing test cases and compute the weight for each sample. The sample weight is combined with a loss function to optimize the accuracy of the DLFL method. To evaluate our approach, we conduct within-project and cross-project fault localization experiments on the Defects4J benchmark. Experimental results show our approach outperforms the traditional DLFL and existing data augmentation methods in fault localization (e.g. localizing 133 faults within Top-5). The experimental results show that applying cost-sensitive learning can effectively alleviate the class imbalance problem in DLFL.Keywords
Funding Information
- National Natural Science Foundation of China (61673384)
- Natural Science Foundation of Shandong province, China (ZR2023QF155)
- Natural Science Foundation of Jiangsu Province, China (BK20181353)
This publication has 63 references indexed in Scilit:
- GBSR: Graph-based suspiciousness refinement for improving fault localizationJournal of Systems and Software, 2024
- A Deep Convolutional Encoder–Decoder–Restorer Architecture for Image DeblurringNeural Processing Letters, 2024
- Code-aware fault localization with pre-training and interpretable machine learningExpert Systems with Applications, 2023
- GNet4FL: effective fault localization via graph convolutional neural networkAutomated Software Engineering, 2023
- A light-weight data augmentation method for fault localizationInformation and Software Technology, 2023
- Cost-sensitive Dictionary Learning for Software Defect PredictionNeural Processing Letters, 2020
- Improving deep‐learning‐based fault localization with resamplingJournal of Software: Evolution and Process, 2020
- A theoretical analysis on cloning the failed test cases to improve spectrum-based fault localizationJournal of Systems and Software, 2017
- Metallaxis‐FL: mutation‐based fault localizationSoftware Testing, Verification and Reliability, 2013
- Principal Component Analysis1986