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 条
  • [41] A Hierarchical Approach for Advanced Persistent Threat Detection with Attention-Based Graph Neural Networks
    Li, Zitong
    Cheng, Xiang
    Sun, Lixiao
    Zhang, Ji
    Chen, Bing
    [J]. SECURITY AND COMMUNICATION NETWORKS, 2021, 2021
  • [42] Attention-Based Graph Convolution Networks for Event Detection
    National University of Defense Technology, Science and Technology on Information Systems Engineering Laboratory, Changsha, China
    [J]. Proc. - Int. Conf. Big Data Inf. Anal., BigDIA, (185-190):
  • [43] CLG-Trans: Contrastive learning for code summarization via graph attention-based transformer
    Zeng, Jianwei
    He, Yutong
    Zhang, Tao
    Xu, Zhou
    Han, Qiang
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2023, 226
  • [44] Attention-based Deep Learning for Visual Servoing
    Wang, Bo
    Li, Yuan
    [J]. 2020 CHINESE AUTOMATION CONGRESS (CAC 2020), 2020, : 4388 - 4393
  • [45] Temporal learning in predictive health management using channel-spatial attention-based deep neural networks
    Liu, Chien-Liang
    Su, Huan-Ci
    [J]. ADVANCED ENGINEERING INFORMATICS, 2024, 62
  • [46] Attention-Based Ensemble for Deep Metric Learning
    Kim, Wonsik
    Goyal, Bhavya
    Chawla, Kunal
    Lee, Jungmin
    Kwon, Keunjoo
    [J]. COMPUTER VISION - ECCV 2018, PT I, 2018, 11205 : 760 - 777
  • [47] Deep representation-based transfer learning for deep neural networks
    Yang, Tao
    Yu, Xia
    Ma, Ning
    Zhang, Yifu
    Li, Hongru
    [J]. KNOWLEDGE-BASED SYSTEMS, 2022, 253
  • [48] Attention-Based Aggregation Graph Networks for Knowledge Graph Information Transfer
    Zhao, Ming
    Jia, Weijia
    Huang, Yusheng
    [J]. ADVANCES IN KNOWLEDGE DISCOVERY AND DATA MINING, PAKDD 2020, PT II, 2020, 12085 : 542 - 554
  • [49] Attention-based Deep Multiple Instance Learning
    Ilse, Maximilian
    Tomczak, Jakub M.
    Welling, Max
    [J]. INTERNATIONAL CONFERENCE ON MACHINE LEARNING, VOL 80, 2018, 80
  • [50] Attention-Based Deep Learning Models for Detection of Fake News in Social Networks
    Ramya S.P.
    Eswari R.
    [J]. International Journal of Cognitive Informatics and Natural Intelligence, 2021, 15 (04)