Using Graph Neural Network to Analyse and Detect Annotation Misuse in Java']Java Code

被引:0
|
作者
Yang, Jingbo [1 ]
Ji, Xin [2 ]
Wu, Wenjun [3 ]
Ren, Jian [1 ]
Zhang, Kui [4 ]
Zhang, Wenya [2 ]
Wang, Qingliang [2 ]
Dong, Tingting [5 ]
机构
[1] Beihang Univ, Sch Comp Sci & Engn, Beijing, Peoples R China
[2] State Grid Nanjing Power Supply Co, Nanjing, Peoples R China
[3] Beihang Univ, Inst Artificial Intelligence, Beijing, Peoples R China
[4] Beihang Univ, State Key Lab Complex & Crit Software Environm, Beijing, Peoples R China
[5] China Elect Power Res Inst, Beijing, Peoples R China
关键词
!text type='Java']Java[!/text] annotation; Stack Overflow; Statistic analysis; Misuse detection; GNN;
D O I
10.1007/978-981-97-5663-6_11
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Annotations have been widely applied in Java projects to support agile development, expecially in software enterprises. Developers make full use of annotations to conveniently implement special functions such as creating objects, operating database and providing URL links for network requests and so on. However, analyzing the usage of annotations in Java code data is not easy for developers, and the misuse of annotations can sometimes cause serious problems for their Java programs. Traditional statistic analysis method usually relies on the frequency of code and may not perform well in low frequent data. In this paper, we focus on leveraging graph neural network (GNN) to analyse and grasp Java annotation usage knowledge and detect misused annotations. Firstly, to better represent the project structure and the annotation usage knowledge, a novel annotation usage project structure graph (AUPSG) is designed. Secondly, using AUPSG, a structure-aware GNN based model is proposed to analyze and acquire knowledge of annotation usage during the training stage. This is achieved by categorizing code nodes at the class, method, field, and parameter levels into suitable annotations. With the learnt knowledge, the proposed model can more accurately detect annotation misuse. Finally, two annotation misuse datasets, each of which includes 150 independent Java projects/files, are curated to evaluate different annotation misuse detection methods. The performance evaluation results demonstrate that our method can achieve better performance than state-of-the-art baseline models in terms of precision, recall, and F1.
引用
收藏
页码:120 / 131
页数:12
相关论文
共 50 条
  • [21] Development of Error Management in BPMN Using Java']Java Code
    Nasiri, Ramin
    Barforooshi, Sahar Yousefi
    Latif, G.
    SECOND INTERNATIONAL CONFERENCE ON COMPUTER AND ELECTRICAL ENGINEERING, VOL 1, PROCEEDINGS, 2009, : 268 - +
  • [22] Project Achilles: A Prototype Tool for Static Method-Level Vulnerability Detection of Java']Java Source Code Using a Recurrent Neural Network
    Saccente, Nicholas
    Dehlinger, Josh
    Deng, Lin
    Chakraborty, Suranjan
    Xiong, Yin
    2019 34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING WORKSHOPS (ASEW 2019), 2019, : 114 - 121
  • [23] JAVENGA: JAva']JAva-Based Visualization Environment for Network and Graph Algorithms
    Baloukas, Thanasis
    COMPUTER APPLICATIONS IN ENGINEERING EDUCATION, 2012, 20 (02) : 255 - 268
  • [24] Java']Java Code Clone Detection by Exploiting Semantic and Syntax Information From Intermediate Code-Based Graph
    Yuan, Dawei
    Fang, Sen
    Zhang, Tao
    Xu, Zhou
    Luo, Xiapu
    IEEE TRANSACTIONS ON RELIABILITY, 2023, 72 (02) : 511 - 526
  • [25] Detecting malicious Java']Java code using virtual machine auditing
    Soman, S
    Krintz, C
    Vigna, G
    USENIX ASSOCIATION PROCEEDINGS OF THE 12TH USENIX SECURITY SYMPOSIUM, 2003, : 153 - 167
  • [26] Enabling network management using Java']Java technologies
    Lee, JO
    IEEE COMMUNICATIONS MAGAZINE, 2000, 38 (01) : 116 - 123
  • [27] Auto Clustering Source Code To Detect Plagiarism Of Student Programming Assignments in Java']Java Programming Language
    Amaliah, Yusni
    Musu, Wilem
    Suprianto
    Fadlan, Muhammad
    3RD INTERNATIONAL CONFERENCE ON CYBERNETICS AND INTELLIGENT SYSTEMS (ICORIS 2021), 2021, : 695 - +
  • [28] On the Use of Smelly Examples to Detect Code Smells in Java']JavaScript
    Shoenberger, Ian
    Mkaouer, Mohamed Wiem
    Kessentini, Marouane
    APPLICATIONS OF EVOLUTIONARY COMPUTATION (EVOAPPLICATIONS 2017), PT II, 2017, 10200 : 20 - 34
  • [29] Systematic Exhortation of Code Smell Detection Using JS']JSmell for Java']Java Source Code
    Sangeetha, M.
    Sengottuvelan, P.
    PROCEEDINGS OF THE 2017 INTERNATIONAL CONFERENCE ON INVENTIVE SYSTEMS AND CONTROL (ICISC 2017), 2017, : 384 - 388
  • [30] Verification of Atomicity Preservation in Model-to-Code Transformations using Generic Java']Java Code
    Zhang, Dan
    Bosnacki, Dragan
    van den Brand, Mark
    Huizing, Cornelis
    Kuiper, Ruurd
    Jacobs, Bart
    Wijs, Anton
    PROCEEDINGS OF THE 4TH INTERNATIONAL CONFERENCE ON MODEL-DRIVEN ENGINEERING AND SOFTWARE DEVELOPMENT (MODELSWARD 2016), 2016, : 578 - 588