跳到主要导航 跳到搜索 跳到主要内容

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

  • Jingbo Yang
  • , Xin Ji
  • , Wenjun Wu
  • , Jian Ren*
  • , Kui Zhang
  • , Wenya Zhang
  • , Qingliang Wang
  • , Tingting Dong
  • *此作品的通讯作者
  • Beihang University
  • State Grid Corporation of China

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

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.

源语言英语
主期刊名Advanced Intelligent Computing Technology and Applications - 20th International Conference, ICIC 2024, Proceedings
编辑De-Shuang Huang, Qinhu Zhang, Xiankun Zhang
出版商Springer Science and Business Media Deutschland GmbH
120-131
页数12
ISBN(印刷版)9789819756629
DOI
出版状态已出版 - 2024
活动20th International Conference on Intelligent Computing, ICIC 2024 - Tianjin, 中国
期限: 5 8月 20248 8月 2024

出版系列

姓名Lecture Notes in Computer Science
14875 LNAI
ISSN(印刷版)0302-9743
ISSN(电子版)1611-3349

会议

会议20th International Conference on Intelligent Computing, ICIC 2024
国家/地区中国
Tianjin
时期5/08/248/08/24

指纹

探究 'Using Graph Neural Network to Analyse and Detect Annotation Misuse in Java Code' 的科研主题。它们共同构成独一无二的指纹。

引用此