Enhancing the GLANCE Framework for Line-Level Defect Prediction: An Empirical Study of Semantically-Aware Metrics and Non-Linear Classifiers - Zahid Mujaddid; Ema Utami (Telematika, 2025)
Line-level defect prediction (LLDP) is critical for reducing software maintenance costs, yet its industrial adoption is often hindered by high false alarm rates that erode developer trust. While the state-of-the-art GLANCE-LR framework offers a lightweight solution, it relies on linear classifiers and purely syntactic heuristics, failing to capture the non-linear defect patterns and semantic risks associated with complex code constructs. To bridge the gap between operational efficiency and semantic awareness, this paper proposes GLANCE++, an enhanced framework that integrates a non-linear LightGBM classifier for refined file-level filtering and introduces three semantically-aware line metrics: Cognitive Complexity Score (CCS), API-Weighted Number of Function Calls (AW-NFC), and Variable-Write Count (VWC). These metrics shift the prediction paradigm from counting tokens to modeling "code risk." Empirical evaluation on 19 open-source Java projects (142 releases) reveals that while the non-linear file classifier yields marginal gains, the semantic line-level metrics achieve statistically significant improvements in precision and False Alarm Rate (FAR). However, this increased selectivity introduces a trade-off, resulting in reduced recall compared to the baseline. Our findings demonstrate that improving the semantic intelligence of heuristics yields far greater impact than increasing model complexity. This suggests that future LLDP research should prioritize theoretically grounded risk metrics over computationally expensive deep learning architectures to ensure practical deployment in real-time CI/CD pipelines.