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

IF 5.7 2区 计算机科学 Q1 COMPUTER SCIENCE, HARDWARE & ARCHITECTURE
Haiyang Liu;Zhiqiang Li;Hongyu Zhang;Xiao-Yuan Jing;Jinhui Liu
{"title":"CFG2AT: Control Flow Graph and Graph Attention Network-Based Software Defect Prediction","authors":"Haiyang Liu;Zhiqiang Li;Hongyu Zhang;Xiao-Yuan Jing;Jinhui Liu","doi":"10.1109/TR.2024.3503688","DOIUrl":null,"url":null,"abstract":"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% in <italic>F1</i>, 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% in <italic>F1</i>, 8.93%–13.27% in AUC, and 36.92%–94.89% in MCC under CPDP, respectively.","PeriodicalId":56305,"journal":{"name":"IEEE Transactions on Reliability","volume":"74 3","pages":"3412-3426"},"PeriodicalIF":5.7000,"publicationDate":"2024-12-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Reliability","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/10779185/","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, HARDWARE & ARCHITECTURE","Score":null,"Total":0}
引用次数: 0

Abstract

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% in F1, 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% in F1, 8.93%–13.27% in AUC, and 36.92%–94.89% in MCC under CPDP, respectively.
基于控制流图和图注意网络的软件缺陷预测
软件缺陷预测(SDP)通过帮助早期识别潜在缺陷,在确保高质量的软件开发中起着关键作用。多年来,这个实践在软件工程领域获得了大量的关注。深度学习的最新进展主要集中在从抽象语法树(ast)中提取通用语法特征。然而,基于ast的神经网络模型可能会忽略与嵌入在源代码中的控制流相关的重要结构信息。鉴于软件缺陷经常受到控制流模式的影响,本文提出了一种新的基于控制流图和图注意(CFG2AT)网络的SDP方法。CFG2AT是专门为自动识别软件缺陷而设计的,并包含一个图结构的注意单元,以有效地捕获控制流程信息。为了评估CFG2AT的有效性,我们在项目内和跨项目缺陷预测设置下,使用来自6个不同开源软件项目的15个版本的数据进行了广泛的实验。实验结果表明,我们提出的CFG2AT方法在缺陷预测方面普遍优于一系列竞争方法。项目内缺陷预测的马修斯相关系数(MCC)改善幅度分别为7.09% ~ 12.80%、1.30% ~ 4.15%和6.78% ~ 17.54%,CPDP预测的F1、AUC和MCC分别为23.76% ~ 44.79%、8.93% ~ 13.27%和36.92% ~ 94.89%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
IEEE Transactions on Reliability
IEEE Transactions on Reliability 工程技术-工程:电子与电气
CiteScore
12.20
自引率
8.50%
发文量
153
审稿时长
7.5 months
期刊介绍: IEEE Transactions on Reliability is a refereed journal for the reliability and allied disciplines including, but not limited to, maintainability, physics of failure, life testing, prognostics, design and manufacture for reliability, reliability for systems of systems, network availability, mission success, warranty, safety, and various measures of effectiveness. Topics eligible for publication range from hardware to software, from materials to systems, from consumer and industrial devices to manufacturing plants, from individual items to networks, from techniques for making things better to ways of predicting and measuring behavior in the field. As an engineering subject that supports new and existing technologies, we constantly expand into new areas of the assurance sciences.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信