Attention-Based Method for Design Pattern Detection

被引:1
|
作者
Mzid, Rania [1 ,2 ]
Rezgui, Ilyes [1 ]
Ziadi, Tewfik [3 ]
机构
[1] Univ Tunis El Manar, ISI, 2 Rue Abourraihan Al Bayrouni, Ariana, Tunisia
[2] Univ Sfax, CES Lab ENIS, Sfax, Tunisia
[3] Sorbonne Univ, CNRS, LIP6, F-75005 Paris, France
来源
关键词
Design pattern detection; Feature extraction; classification; Transformer architecture;
D O I
10.1007/978-3-031-70797-1_6
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Design patterns are standard solutions to recurrent software engineering problems. The use of design patterns helps developers improve software quality. However, when integrating design patterns into their systems, software developers usually do not document their use. To this end, the use of an automatic approach for their detection may accelerate program comprehension, assist developers in software refactoring, and reduce efforts during the maintenance task. In this paper, we propose an attention-based approach for design pattern detection. Specifically, we utilize an automatic feature extraction step with a transformer-based model incorporating the attention mechanism. Based on an unsupervised approach, this step learns from source code to identify code attributes and then produces embedding vectors. These vectors capture syntactic and semantic information related to design pattern implementations and serve as input to train a classifier for the design pattern detection task. The attention mechanism is used to produce important representative features of design pattern implementations and improve the accuracy of the classification model. The evaluation shows that our classifier detects GoF design patterns with an accuracy score of 86%, precision of 87%, recall of 86%, and F1-score of 86%. The comparison of our findings with state-of-the-art methods shows an improvement in (i) precision of 25%, (ii) recall of 6%, and (iii) F1-score of 8%.
引用
收藏
页码:86 / 101
页数:16
相关论文
共 50 条
  • [1] A Novel Attention-Based Keyframe Detection Method
    Shih, Huang-Chia
    DIGITAL INFORMATION AND COMMUNICATION TECHNOLOGY AND ITS APPLICATIONS, PT II, 2011, 167 (02): : 436 - 447
  • [2] An Attention-Based Detection Method of Fatigue Cracks on Steel
    Yu, Qian-Qian
    Wang, Jie
    Gu, Xiang-Lin
    He, Sudao
    Zhang, Shenghan
    STRUCTURAL CONTROL & HEALTH MONITORING, 2025, 2025 (01):
  • [3] Fall-Attention: An Attention-Based Fall Detection Method for Adjoint Activities
    Xiao, Yalong
    Zhu, Junfeng
    Zhang, Shigeng
    Liu, Xuan
    Guo, Song
    IEEE TRANSACTIONS ON MOBILE COMPUTING, 2024, 23 (07) : 7895 - 7909
  • [4] Attention-Based Vandalism Detection in OpenStreetMap
    Tempelmeier, Nicolas
    Demidova, Elena
    PROCEEDINGS OF THE ACM WEB CONFERENCE 2022 (WWW'22), 2022, : 643 - 651
  • [5] Attention-based vanishing point detection
    Stentiford, Fred
    2006 IEEE International Conference on Image Processing, ICIP 2006, Proceedings, 2006, : 417 - 420
  • [6] Fault Detection Method for Wind Turbine Generators Based on Attention-Based Modeling
    Zhang, Yu
    Huang, Runcai
    Li, Zhiwei
    APPLIED SCIENCES-BASEL, 2023, 13 (16):
  • [7] Attention-Based Underwater Oil Leakage Detection
    Rehman, Muhammad Zia Ur
    Shanmuganathan, Manimurugan
    Paul, Anand
    2023 IEEE CONFERENCE ON ARTIFICIAL INTELLIGENCE, CAI, 2023, : 214 - 217
  • [8] ADD: Attention-Based DeepFake Detection Approach
    Khormali, Aminollah
    Yuan, Jiann-Shiun
    BIG DATA AND COGNITIVE COMPUTING, 2021, 5 (04)
  • [9] Multiscale Attention-Based Hand Keypoint Detection
    Dutta, H. Pallab Jyoti
    Bhuyan, M. K.
    Karsh, Ram Kumar
    Alfarhood, Sultan
    Safran, Mejdl
    IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, 2024, 73
  • [10] An Attention-based Method for Multi-label Facial Action Unit Detection
    Le Hoai, Duy
    Lim, Eunchae
    Choi, Eunbin
    Kim, Sieun
    Pant, Sudarshan
    Lee, Guee-Sang
    Kim, Soo-Huyng
    Yang, Hyung-Jeong
    2022 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION WORKSHOPS, CVPRW 2022, 2022, : 2453 - 2458