Return
Cost-adaptive multi-level semantic feature learning for source code based bug severity prediction
DOI:10.1016/j.scico.2026.103444.png)
Abstract
En 中文
Bug severity prediction plays a crucial role in software development by enabling timely defect management. Traditional approaches that rely on bug reports are prone to subjective bias, often leading to inaccurate severity assessments. In contrast, source code-based methods can directly learn code representations to more accurately identify potential defects. However, existing source code-based models don't make full use of the hierarchical deep semantic information, and don't pay enough attention on the intrinsic class imbalance issue. To overcome these challenges, this paper presents the Cost-Adaptive Multi-level sEmantic feature Learning (CAMEL) framework for bug severity prediction. The framework comprises three core modules: the feature extraction module, the Multi-level Semantic Information Fusion (MSIF) module, and the Cost Weight Optimization (CWO) module. Specifically, the feature extraction module leverages CodeBERT to capture multi-level semantic information from source code. The MSIF then dynamically aggregates layer-specific features from each CodeBERT layer using an LSTM combined with a hierarchical attention mechanism, thereby preserving global semantic integrity. Finally, the CWO module mitigates the influence of class imbalance issue by dynamically adjusting class weight parameters. Experiments conducted on a dataset of 3342 method-level code snippets with varying bug severity levels demonstrate that CAMEL significantly outperforms state-of-the-art methods across key metrics, including F1-Weighted, Precision, Recall, and MCC.
Keywords:
Bug severity prediction
Code representation
Cost sensitivity
Semantic information fusion
Journal
S
IF:
1.4
Papers:
50
Citations:
1.6K

