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 条
  • [1] Automatic Annotation of Confidential Data in Java']Java Code
    Bastys, Iulia
    Bolignano, Pauline
    Raimondi, Franco
    Schoepe, Daniel
    FOUNDATIONS AND PRACTICE OF SECURITY, FPS 2021, 2022, 13291 : 146 - 161
  • [2] Annotation-based Parallelization of Java']Java Code
    Mehrabi, Mostafa
    Giacaman, Nasser
    Sinnen, Oliver
    2017 IEEE INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM WORKSHOPS (IPDPSW), 2017, : 775 - 784
  • [3] Neural Network VS. Bayesian Network to Detect Java']Java Card Mutants
    El Farissi, Ilhame
    Azizi, Mostafa
    Lanet, Jean-Louis
    Moussaoui, Mimoun
    2013 AASRI CONFERENCE ON INTELLIGENT SYSTEMS AND CONTROL, 2013, 4 : 132 - 137
  • [4] Translating Java']Java code to graph transformation systems
    Corradini, A
    Dotti, FL
    Foss, L
    Ribeiro, L
    GRAPH TRANSFORMATIONS, PROCEEDINGS, 2004, 3256 : 383 - 398
  • [5] DeepAnna: Deep Learning based Java']Java Annotation Recommendation and Misuse Detection
    Liu, Yi
    Yan, Yadong
    Sha, Chaofeng
    Peng, Xin
    Chen, Bihuan
    Wang, Chong
    2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2022), 2022, : 685 - 696
  • [6] SJBCD: A Java']Java Code Clone Detection Method Based on Bytecode Using Siamese Neural Network
    Wan, Bangrui
    Dong, Shuang
    Zhou, Jianjun
    Qian, Ying
    APPLIED SCIENCES-BASEL, 2023, 13 (17):
  • [7] A Java']Java Code Annotation Approach for Model Checking Software Systems
    Ferreira, Glauber
    Loureiro, Emerson
    Oliveira, Elthon
    APPLIED COMPUTING 2007, VOL 1 AND 2, 2007, : 1536 - 1537
  • [8] JGNN: Graph Neural Networks on native Java']Java
    Krasanakis, Emmanouil
    Papadopoulos, Symeon
    Kompatsiaris, Ioannis
    SOFTWAREX, 2023, 23
  • [9] Application of neural network algorithms in investment appraisals using Java']Java
    Williams, G
    Howe, R
    INTELLIGENT SYSTEMS, 2002, : 24 - 31
  • [10] An Efficient and Scalable Platform for Java']Java Source Code Analysis Using Overlaid Graph Representations
    Rodriguez-Prieto, Oscar
    Mycroft, Alan
    Ortin, Francisco
    IEEE ACCESS, 2020, 8 : 72239 - 72260