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 条
  • [41] Software Defect Prediction Using a Hybrid Model Based on Semantic Features Learned from the Source Code
    Miholca, Diana-Lucia
    Czibula, Gabriela
    KNOWLEDGE SCIENCE, ENGINEERING AND MANAGEMENT, KSEM 2019, PT I, 2019, 11775 : 262 - 274
  • [42] Software Defect Prediction Based on Fourier Learning
    Yang, Kang
    Yu, Huiqun
    Fan, Guisheng
    Yang, Xingguang
    Zheng, Song
    Leng, Chunxia
    PROCEEDINGS OF THE 2018 IEEE INTERNATIONAL CONFERENCE ON PROGRESS IN INFORMATICS AND COMPUTING (PIC), 2018, : 388 - 392
  • [43] Deep learning based software defect prediction
    Qiao, Lei
    Li, Xuesong
    Umer, Qasim
    Guo, Ping
    NEUROCOMPUTING, 2020, 385 : 100 - 110
  • [44] Graph Convolutional Neural Networks with Geometric and Discrimination information
    Shang, Ronghua
    Meng, Yang
    Zhang, Weitong
    Shang, Fanhua
    Jiao, Licheng
    Yang, Shuyuan
    ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE, 2021, 104
  • [45] Deep Semantic Feature Learning with Embedded Static Metrics for Software Defect Prediction
    Fan, Guisheng
    Diao, Xuyang
    Yu, Huiqun
    Yang, Kang
    Chen, Liqiong
    2019 26TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC), 2019, : 244 - 251
  • [46] IC-GraF: An Improved Clustering with Graph-Embedding-Based Features for Software Defect Prediction
    Wang, Xuanye
    Lu, Lu
    Tian, Qingyan
    Lin, Haishan
    IET SOFTWARE, 2024, 2024
  • [47] Defect prediction in software using spiderhunt-based deep convolutional neural network classifier
    Prashanthi M.
    Miryala C.M.
    International Journal of Networking and Virtual Organisations, 2022, 27 (04) : 337 - 357
  • [48] Multi-task deep neural networks for just-in-time software defect prediction on mobile apps
    Huang, Qiguo
    Li, Zhengliang
    Gu, Qing
    CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2024, 36 (10)
  • [49] A novel approach for software defect prediction through hybridizing gradual relational association rules with artificial neural networks
    Miholca, Diana-Lucia
    Czibula, Gabriela
    Czibula, Istvan Gergely
    INFORMATION SCIENCES, 2018, 441 : 152 - 170
  • [50] AdapGL: An adaptive graph learning algorithm for traffic prediction based on spatiotemporal neural networks
    Zhang, Wei
    Zhu, Fenghua
    Lv, Yisheng
    Tan, Chang
    Liu, Wen
    Zhang, Xin
    Wang, Fei-Yue
    TRANSPORTATION RESEARCH PART C-EMERGING TECHNOLOGIES, 2022, 139