SEMay 7

Exploring the Effectiveness of Abstract Syntax Tree Patterns for Algorithm Recognition

arXiv:2605.0609850.5
Predicted impact top 44% in SE · last 90 daysOriginality Synthesis-oriented
AI Analysis

For software maintenance and re-engineering, this work provides a more accurate and scalable method for recognizing algorithm implementations, though it is domain-specific and incremental.

The paper presents an AST-based approach for algorithm recognition, achieving an average F1-score of 0.74 on the BigCloneEval benchmark, outperforming CodeLlama (0.35) and code clone detection tools (recall 0.62 vs. best tool 0.20).

The automated recognition of algorithm implementations can support many software maintenance and re-engineering 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 F1-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.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes