Detecting Runtime Exceptions by Deep Code Representation Learning with Attention-Based Graph Neural Networks

被引:0
|
作者
Li, Rongfan [1 ]
Chen, Bihuan [1 ]
Zhang, Fengyi [1 ]
Sun, Chao [1 ]
Peng, Xin [1 ]
机构
[1] Fudan Univ, Sch Comp Sci, Shanghai Key Lab Data Sci, Shanghai, Peoples R China
基金
中国国家自然科学基金;
关键词
runtime exceptions; deep learning; ISSUES;
D O I
10.1109/SANER53432.2022.00053
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Uncaught runtime exceptions have been recognized as one of the commonest root causes of real-life exception bugs in Java applications. However, existing runtime exception detection techniques rely on symbolic execution or random testing, which may suffer the scalability or coverage problem. Rule-based bug detectors (e.g., SpotBugs) provide limited rule support for runtime exceptions. Inspired by the recent successes in applying deep learning to bug detection, we propose a deep learning-based technique, named DREX, to identify not only the types of runtime exceptions that a method might signal but also the statement scopes that might signal the detected runtime exceptions. It is realized by graph-based code representation learning with (i) a lightweight analysis to construct a joint graph of CFG, DFG and AST for each method without requiring a build environment so as to comprehensively characterize statement syntax and semantics and (ii) an attention-based graph neural network to learn statement embeddings in order to distinguish different types of potentially signaled runtime exceptions with interpretability. Our evaluation on 54,255 methods with caught runtime exceptions and 54,255 methods without caught runtime exceptions from 5,996 GitHub Java projects has indicated that DREX improves baseline approaches by up to 18.2% in exact accuracy and 41.6% in F1-score. DREX detects 20 new uncaught runtime exceptions in 13 real-life projects, 7 of them have been fixed, while none of them is detected by rule-based bug detectors (i.e., SpotBugs and PMD).
引用
收藏
页码:373 / 384
页数:12
相关论文
共 50 条
  • [1] Detecting Runtime Exceptions by Deep Code Representation Learning with Attention-Based Graph Neural Networks
    School of Computer Science, Fudan University, Shanghai Key Laboratory of Data Science, China
    [J]. Proc. - IEEE Int. Conf. Softw. Anal., Evol. Reengineering, SANER, 2022, (373-384):
  • [2] Attention-based graph neural networks: a survey
    Chengcheng Sun
    Chenhao Li
    Xiang Lin
    Tianji Zheng
    Fanrong Meng
    Xiaobin Rui
    Zhixiao Wang
    [J]. Artificial Intelligence Review, 2023, 56 : 2263 - 2310
  • [3] Attention-based graph neural networks: a survey
    Sun, Chengcheng
    Li, Chenhao
    Lin, Xiang
    Zheng, Tianji
    Meng, Fanrong
    Rui, Xiaobin
    Wang, Zhixiao
    [J]. ARTIFICIAL INTELLIGENCE REVIEW, 2023, 56 (SUPPL 2) : 2263 - 2310
  • [4] Improving Bug Detection via Context-Based Code Representation Learning and Attention-Based Neural Networks
    Li, Yi
    Wang, Shaohua
    Nguyen, Tien N.
    Son Van Nguyen
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (OOPSLA):
  • [5] TemporalGAT: Attention-Based Dynamic Graph Representation Learning
    Fathy, Ahmed
    Li, Kan
    [J]. ADVANCES IN KNOWLEDGE DISCOVERY AND DATA MINING, PAKDD 2020, PT I, 2020, 12084 : 413 - 423
  • [6] Revisiting Attention-Based Graph Neural Networks for Graph Classification
    Tao, Ye
    Li, Ying
    Wu, Zhonghai
    [J]. PARALLEL PROBLEM SOLVING FROM NATURE - PPSN XVII, PPSN 2022, PT I, 2022, 13398 : 442 - 458
  • [7] Visual Landmark Learning Via Attention-Based Deep Neural Networks
    You, Mingyu
    Luo, Chaoxian
    Zhou, Hongjun
    [J]. IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, 2021, 70
  • [8] Seizure localisation with attention-based graph neural networks
    Grattarola, Daniele
    Livi, Lorenzo
    Alippi, Cesare
    Wennberg, Richard
    Valiante, Taufik A.
    [J]. EXPERT SYSTEMS WITH APPLICATIONS, 2022, 203
  • [9] Demystifying Oversmoothing in Attention-Based Graph Neural Networks
    Wu, Xinyi
    Ajorlou, Amir
    Wu, Zihui
    Jadbabaie, Ali
    [J]. ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 36 (NEURIPS 2023), 2023,
  • [10] GAN-based deep neural networks for graph representation learning
    Zhao, Ming
    Zhang, Yinglong
    [J]. ENGINEERING REPORTS, 2022, 4 (11)