CFG2AT: Control Flow Graph and Graph Attention Network-Based Software Defect Prediction

Haiyang Liu, Zhiqiang Li, Hongyu Zhang, Xiao‐Yuan Jing, Jinhui Liu · IEEE Transactions on Reliability · 2024

Software defect prediction (SDP) plays a pivotal role in ensuring high-quality software development by aiding in the early identification of potential defects. This practice has gained substantial attention in the field of software engineering over the years. Recent advancements in deep learning have primarily focused on extracting general syntactic features from abstract syntax trees (ASTs) for SDP. However, AST-based neural network models might overlook important structural information related to control flows embedded within the source code. Given that software defects are often influenced by control flow patterns, this article proposes a novel SDP approach called control flow graph and graph attention (CFG2AT) network-based SDP. CFG2AT is specifically designed to automatically identify software defects and contains a graph-structured attention unit to effectively capture control flow information. To evaluate the effectiveness of CFG2AT, we carried out extensive experiments using data from 15 versions of six different open-source software projects under both within-project and cross-project defect prediction settings. Experimental results demonstrate that our proposed CFG2AT approach generally outperforms a range of competing methods for defect prediction. The improvement is 7.09%–12.80% inF1, 1.30%–4.15% in area under curve (AUC), and 6.78%–17.54% in Matthews correlation coefficient (MCC) under within-project defect prediction, and 23.76%–44.79% inF1, 8.93%–13.27% in AUC, and 36.92%–94.89% in MCC under CPDP, respectively.

Read the paper · More papers on PaperTik