Treffer: Line-level defect prediction based on preceding line-aware and inter-line semantics enhancement.
Weitere Informationen
Software defect prediction aims to identify potential faults in source code, enabling developers to allocate testing resources more precisely. Most existing studies predominantly focus on coarse-grained, file-level analysis, which overlooks crucial semantic relationships between consecutive code lines, such as variable definitions and control-flow dependencies. The lack of this inter-line context results in ambiguous line-level semantics, ultimately reducing the accuracy of defect localization at the line level. Although recent line-level approaches have shown improvements, they still pay inadequate attention to the directional influence of preceding or following lines, leaving causal and sequential dependencies insufficiently explored. This work aims to better leverage contextual information to obtain richer line-level semantic representations and thereby further improve the accuracy of line-level defect prediction. We propose a Preceding LinE-Aware and inter-line Semantics Enhancement (PLEASE) framework with two complementary modules: (i) The Preceding Line-Aware (PLA) module models how preceding lines influence the current line, capturing directional semantic flows and preserving key contextual cues. (ii) The Dual-Attention Inter-Line Information Fusion (DAIF) module enhances inter-line representations via self-attention for fine-grained dependencies and cross-attention for multi-source semantic integration. Together, these modules enrich context modeling and generate more discriminative line-level embeddings for defect localization. Extensive experiments demonstrate that PLEASE exhibits very competitive performance compared with several state-of-the-art approaches in software defect prediction tasks. By explicitly leveraging the influence of preceding lines and inter-line dependencies, our approach effectively resolves the semantic ambiguity caused by missing contextual information between lines, offering a novel perspective for advancing fine-grained software defect localization. Our code is available at https://github.com/PLEASE-research/PLEASE. • We propose a line-level defect prediction framework with preceding-line awareness. • A preceding line-aware module captures contextual semantics to enhance representations. • A dual-attention module models inter-line dependencies and fuses semantic features. • Extensive experiments show improved accuracy in line-level defect localization. [ABSTRACT FROM AUTHOR]
Copyright of Information & Software Technology is the property of Elsevier B.V. and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)