The current manuscript presents a predictive mechanism towards analyzing software defects by developing a line-level fault prediction technique. Current methodologies rely on customized attributes and overlook the sophisticated structural and semantic characteristics inherent in programming languages. This oversight often led to suboptimal defect identification, as code defects are intricately scrambled with their contextual environment. Moreover, conventional software defect prediction (SDP) strategies, typically focusing on larger code units such as modules or classes, impede precise error localization. To address these challenges, this study proposes an automated scheme utilizing a recurrent neural network (RNN) with an attention layer to analyze line-level quantifiers within the code, such as the number of pairwise operations and single operand operators. The efficacy of this learning-driven scheme is validated through comprehensive experiments conducted on several C++ programs. The experimental results demonstrate a 95.8% recall, 83.12% precision, and 90.35% accuracy in identifying fault-prone lines within a testing dataset. These outcomes confirm the effectiveness of proposed SDP scheme in accurately identifying the defects and highlighting its inter-project capabilities, exhibiting the model's adaptability across different software projects.
Copyrights © 2025