Exploring the Effectiveness of Abstract Syntax Tree Patterns for Algorithm Recognition

被引:0
|
作者
Neumuller, Denis [1 ]
Straub, Raphael [1 ]
Sihler, Florian [1 ]
Tichy, Matthias [1 ]
机构
[1] Univ Ulm, Ulm, Germany
关键词
algorithm recognition; program comprehension; pattern matching; abstract syntax tree; domain-specific language; reverse engineering; maintenance; OPEN-SOURCE SOFTWARE;
D O I
10.1109/ICCQ60895.2024.10576984
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The automated recognition of algorithm implementations can support many software maintenance and reengineering activities by providing knowledge about the concerns present in the code base. Moreover, recognizing inefficient algorithms like Bubble Sort and suggesting superior alternatives from a library can help in assessing and improving the quality of a system. Approaches from related work suffer from usability as well as scalability issues and their accuracy is not evaluated. In this paper, we investigate how well our approach based on the abstract syntax tree of a program performs for automatic algorithm recognition. To this end, we have implemented a prototype consisting of: A domain-specific language designed to capture the key features of an algorithm and used to express a search pattern on the abstract syntax tree, a matching algorithm to find these features, and an initial catalog of "ready to use" patterns. To create our search patterns we performed a web search using the algorithm name and described key features of the found reference implementations with our domain-specific language. We evaluate our prototype on a subset of the BigCloneEval benchmark containing algorithms like Fibonacci, Bubble Sort, and Binary Search. We achieve an average F-1-score of 0.74 outperforming the large language model Codellama which attains 0.35. Additionally, we use multiple code clone detection tools as a baseline for comparison, achieving a recall of 0.62 while the best-performing tool reaches 0.20.
引用
收藏
页数:18
相关论文
共 50 条
  • [11] Implementation of a Training Parser Using Explicit Abstract Syntax Tree
    Penev, Ivaylo
    Karova, Milena
    COMPUTER SYSTEMS AND TECHNOLOGIES, 2019, : 299 - 303
  • [12] Programming Hints Generation based on Abstract Syntax Tree Retrieval
    Wan, Han
    Luo, Hongzhen
    Zhong, Zihao
    Gao, Xiaopeng
    2022 IEEE FRONTIERS IN EDUCATION CONFERENCE, FIE, 2022,
  • [13] COAST: A Conflict-free Replicated Abstract Syntax Tree
    Munsters, Aaron
    Pupo, Angel Luis Scull
    Nicolay, Jens
    PROCEEDINGS OF THE 17TH INTERNATIONAL CONFERENCE ON SOFTWARE TECHNOLOGIES (ICSOFT), 2022, : 187 - 196
  • [14] Extensible intraprocedural flow analysis at the abstract syntax tree level
    Soderberg, Emma
    Ekman, Torbjoern
    Hedin, Gorel
    Magnusson, Eva
    SCIENCE OF COMPUTER PROGRAMMING, 2013, 78 (10) : 1809 - 1827
  • [15] A Study on Abstract Syntax Tree for Development of a Java']JavaScript Compiler
    Kim, Jaehyun
    Lee, Yangsun
    INTERNATIONAL JOURNAL OF GRID AND DISTRIBUTED COMPUTING, 2018, 11 (06): : 37 - 47
  • [16] Automating Abstract Syntax Tree construction for Context Free Grammars
    Arusoaie, Andrei
    Vicol, Daniel Ionut
    14TH INTERNATIONAL SYMPOSIUM ON SYMBOLIC AND NUMERIC ALGORITHMS FOR SCIENTIFIC COMPUTING (SYNASC 2012), 2012, : 152 - 159
  • [17] A Program Plagiarism Detection Approach Based On Abstract Syntax Tree
    Xiong, Hao
    Yan, Hai-hua
    Li, Zhou-jun
    Li, Hu
    ICAIE 2009: PROCEEDINGS OF THE 2009 INTERNATIONAL CONFERENCE ON ARTIFICIAL INTELLIGENCE AND EDUCATION, VOLS 1 AND 2, 2009, : 196 - 205
  • [18] Loop Transformations using Clang's Abstract Syntax Tree
    Kruse, Michael
    50TH INTERNATIONAL CONFERENCE ON PARALLEL PROCESSING WORKSHOP PROCEEDINGS - ICPP WORKSHOPS '21, 2021,
  • [19] Visualizing Project Evolution Through Abstract Syntax Tree Analysis
    Feist, Michael D.
    Santos, Eddie Antonio
    Watts, Ian
    Hindle, Abram
    2016 IEEE WORKING CONFERENCE ON SOFTWARE VISUALIZATION, 2016, : 11 - 20
  • [20] Deep Learning With Customized Abstract Syntax Tree for Bug Localization
    Liang, Hongliang
    Sun, Lu
    Wang, Meilin
    Yang, Yuxing
    IEEE ACCESS, 2019, 7 : 116309 - 116320