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 条
  • [41] Attention-based residual autoencoder for video anomaly detection
    Viet-Tuan Le
    Yong-Guk Kim
    Applied Intelligence, 2023, 53 : 3240 - 3254
  • [42] Attention-based residual autoencoder for video anomaly detection
    Le, Viet-Tuan
    Kim, Yong-Guk
    APPLIED INTELLIGENCE, 2023, 53 (03) : 3240 - 3254
  • [43] An attention-based automatic vulnerability detection approach with GGNN
    Gaigai Tang
    Lin Yang
    Long Zhang
    Weipeng Cao
    Lianxiao Meng
    Hongbin He
    Hongyu Kuang
    Feng Yang
    Huiqiang Wang
    International Journal of Machine Learning and Cybernetics, 2023, 14 : 3113 - 3127
  • [44] A novel transformer attention-based approach for sarcasm detection
    Khan, Shumaila
    Qasim, Iqbal
    Khan, Wahab
    Aurangzeb, Khursheed
    Khan, Javed Ali
    Anwar, Muhammad Shahid
    EXPERT SYSTEMS, 2025, 42 (01)
  • [45] An Attention-Based Token Pruning Method for Vision Transformers
    Luo, Kaicheng
    Li, Huaxiong
    Zhou, Xianzhong
    Huang, Bing
    ROUGH SETS, IJCRS 2022, 2022, 13633 : 274 - 288
  • [46] A Design Pattern Detection Method Based on Similarity Scoring
    Wang L.
    Song H.
    Wang W.
    Hunan Daxue Xuebao/Journal of Hunan University Natural Sciences, 2019, 46 (12): : 50 - 57
  • [47] Multistructure Graph Classification Method With Attention-Based Pooling
    Xu, Yuhua
    Wang, Junli
    Guang, Mingjian
    Yan, Chungang
    Jiang, Changjun
    IEEE TRANSACTIONS ON COMPUTATIONAL SOCIAL SYSTEMS, 2023, 10 (02) : 602 - 613
  • [48] A selective attention-based method for visual pattern recognition with application to handwritten digit recognition and face recognition
    Salah, AA
    Alpaydin, E
    Akarun, L
    IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, 2002, 24 (03) : 420 - 425
  • [49] Method of Attention-Based CNN for Weighing Pleurotus eryngii
    Jia, Junmin
    Hu, Fei
    Zhang, Xubo
    Ben, Zongyou
    Wang, Yifan
    Chen, Kunjie
    AGRICULTURE-BASEL, 2023, 13 (09):
  • [50] Log Attention - Assessing Software Releases with Attention-Based Log Anomaly Detection
    Munir, Sohail
    Ali, Hamid
    Qureshi, Jahangeer
    SERVICE-ORIENTED COMPUTING, ICSOC 2021 WORKSHOPS, 2022, 13236 : 139 - 150