Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networks

被引:11
|
作者
Zhao, Zhehao [1 ]
Yang, Bo [2 ]
Li, Ge [1 ]
Liu, Huai [3 ]
Jin, Zhi [1 ]
机构
[1] Peking Univ, Key Lab High Confidence Software Technol, Beijing 100871, Peoples R China
[2] Beijing Forestry Univ, Sch Informat Sci & Technol, Beijing 100083, Peoples R China
[3] Swinburne Univ Technol, Dept Comp Technol, Hawthorn, Vic 3122, Australia
基金
澳大利亚研究理事会; 中国国家自然科学基金; 国家重点研发计划;
关键词
Graph neural network; Program analysis; Deep learning; Abstract syntax Tree; Control flow graph; NEURAL-NETWORK;
D O I
10.1016/j.jss.2021.111108
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Deep learning is being used extensively in a variety of software engineering tasks, e.g., program classification and defect prediction. Although the technique eliminates the required process of feature engineering, the construction of source code model significantly affects the performance on those tasks. Most recent works was mainly focused on complementing AST-based source code models by introducing contextual dependencies extracted from CFG. However, all of them pay little attention to the representation of basic blocks, which are the basis of contextual dependencies. In this paper, we integrated AST and CFG and proposed a novel source code model embedded with hierarchical dependencies. Based on that, we also designed a neural network that depends on the graph attention mechanism. Specifically, we introduced the syntactic structural of the basic block, i.e., its corresponding AST, in source code model to provide sufficient information and fill the gap. We have evaluated this model on three practical software engineering tasks and compared it with other state-of-the-art methods. The results show that our model can significantly improve the performance. For example, compared to the best performing baseline, our model reduces the scale of parameters by 50% and achieves 4% improvement on accuracy on program classification task. (c) 2021 Elsevier Inc. All rights reserved.
引用
收藏
页数:13
相关论文
共 47 条
  • [41] Distributed Reactive Power Optimization for Energy Internet via Multiagent Deep Reinforcement Learning With Graph Attention Networks
    Xu, Shaolong
    Guo, Sheng
    IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, 2024, 20 (06) : 8696 - 8706
  • [42] Spectral clustering via sparse graph structure learning with application to proteomic signaling networks in cancer
    Banerjee, Sayantan
    Akbani, Rehan
    Baladandayuthapani, Veerabhadran
    COMPUTATIONAL STATISTICS & DATA ANALYSIS, 2019, 132 : 46 - 69
  • [43] Improving Bug Detection via Context-Based Code Representation Learning and Attention-Based Neural Networks
    Li, Yi
    Wang, Shaohua
    Nguyen, Tien N.
    Son Van Nguyen
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (OOPSLA):
  • [44] Deep pairwise learning for user preferences via dual graph attention model in location-based social networks
    Gong, Weihua
    Zheng, Kechen
    Zhang, Shubin
    Hu, Ping
    EXPERT SYSTEMS WITH APPLICATIONS, 2023, 227
  • [45] Health Insurance Fraud Detection via Multiview Heterogeneous Information Networks With Augmented Graph Structure Learning
    Hong, Binsheng
    Lu, Ping
    Chen, Runze
    Lin, Kaibiao
    Yang, Fan
    IEEE TRANSACTIONS ON COMPUTATIONAL SOCIAL SYSTEMS, 2024,
  • [46] Contrastive learning based on hierarchical graph of microstructures through directed energy deposition process to establish process-structure-property relationship via autoencoder
    Chen, Chengxi
    Wong, Stanley Jian Liang
    Tan, Eddie Zhi'En
    Li, Hua
    MATERIALS & DESIGN, 2024, 244
  • [47] Multi-ship encounter situation graph structure learning for ship collision avoidance based on AIS big data with spatio-temporal edge and node attention graph convolutional networks
    Gao, Miao
    Liang, Maohan
    Zhang, Anmin
    Hu, Yingjun
    Zhu, Jixiang
    OCEAN ENGINEERING, 2024, 301