Software defect prediction with semantic and structural information of codes based on Graph Neural Networks

被引:23
|
作者
Zhou, Chunying [1 ]
He, Peng [1 ]
Zeng, Cheng [1 ]
Ma, Ju [1 ]
机构
[1] Hubei Univ, Sch Comp Sci & Informat Engn, Wuhan, Peoples R China
基金
国家重点研发计划;
关键词
Software defect prediction; Class Dependency Network; Convolutional Neural Network; Graph Convolutional Network;
D O I
10.1016/j.infsof.2022.107057
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context: Most defect prediction methods consider a series of traditional manually designed static code metrics. However, only using these hand-crafted features is impractical. Some researchers use the Convolutional Neural Network (CNN) to capture the potential semantic information based on the program's Syntax Trees (ASTs). In recent years, leveraging the dependency relationships between software modules to construct a software network and using network embedding models to capture the structural information have been helpful in defect prediction. This paper simultaneously takes the semantic and structural information into account and proposes a method called CGCN. Objective: This study aims to validate the feasibility and performance of the proposed method in software defect prediction. Method: Abstract Syntax Trees and a Class Dependency Network (CDN) are first generated based on the source code. For ASTs, symbolic tokens are extracted and encoded into vectors. The numerical vectors are then used as input to the CNN to capture the semantic information. For CDN, a Graph Convolutional Network (GCN) is used to learn the structural information of the network automatically. Afterward, the learned semantic and structural information are combined with different weights. Finally, we concatenate the learned features with traditional hand-crafted features to train a classifier for more accurate defect prediction. Results: The proposed method outperforms the state-of-the-art defect prediction models for both within-project prediction (including within-version and cross-version) and cross-project prediction on 21 open-source projects. In general, within-version prediction achieves better performance in the three prediction tasks.Conclusion: The proposed method of combining semantic and structural information can improve the performance of software defect prediction.
引用
收藏
页数:20
相关论文
共 50 条
  • [31] Software defect prediction employing BiLSTM and BERT-based semantic feature
    Uddin, Md Nasir
    Li, Bixin
    Ali, Zafar
    Kefalas, Pavlos
    Khan, Inayat
    Zada, Islam
    SOFT COMPUTING, 2022, 26 (16) : 7877 - 7891
  • [32] Seml: A Semantic LSTM Model for Software Defect Prediction
    Liang, Hongliang
    Yu, Yue
    Jiang, Lin
    Xie, Zhuosi
    IEEE ACCESS, 2019, 7 : 83812 - 83824
  • [33] Deep Semantic Feature Learning for Software Defect Prediction
    Wang, Song
    Liu, Taiyue
    Nam, Jaechang
    Tan, Lin
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2020, 46 (12) : 1267 - 1293
  • [34] Software Defect Detection Method Based on Graph Structure and Deep Neural Network
    Qu, Tianrun
    Liu, Wei
    Zheng, Weining
    Tao, Wenxin
    2022 INTERNATIONAL CONFERENCE ON ASIAN LANGUAGE PROCESSING (IALP 2022), 2022, : 395 - 400
  • [35] ACGDP: An Augmented Code Graph-Based System for Software Defect Prediction
    Xu, Jiaxi
    Ai, Jun
    Liu, Jingyu
    Shi, Tao
    IEEE TRANSACTIONS ON RELIABILITY, 2022, 71 (02) : 850 - 864
  • [36] Software Defect Prediction Using Call Graph Based Ranking (CGBR) Framework
    Turhan, Burak
    Kocak, Gozde
    Bener, Ayse
    PROCEEDINGS OF THE 34TH EUROMICRO CONFERENCE ON SOFTWARE ENGINEERING AND ADVANCED APPLICATIONS, 2008, : 191 - 198
  • [37] A steel surface defect detection model based on graph neural networks
    Pang, Wenkai
    Tan, Zhi
    MEASUREMENT SCIENCE AND TECHNOLOGY, 2024, 35 (04)
  • [38] Modeling Structural Model for Defect Categories Based On Software Metrics for Categorical Defect Prediction
    Gupta, Niketa
    Panwar, Deepali
    Sharma, Ashish
    6TH INTERNATIONAL CONFERENCE ON COMPUTER & COMMUNICATION TECHNOLOGY (ICCCT-2015), 2015, : 46 - 50
  • [39] Software Defect Prediction via Transfer Learning based Neural Network
    Cao, Qimeng
    Sun, Qing
    Cao, Qinghua
    Tan, Huobin
    PROCEEDINGS OF THE 2015 FIRST INTERNATIONAL CONFERENCE ON RELIABILITY SYSTEMS ENGINEERING 2015 ICRSE, 2015,
  • [40] A novel software defect prediction method based on hierarchical neural network
    Yu, Huiqun
    Sun, Xingjie
    Zhou, Ziyi
    Fan, Guisheng
    2021 IEEE 45TH ANNUAL COMPUTERS, SOFTWARE, AND APPLICATIONS CONFERENCE (COMPSAC 2021), 2021, : 366 - 375