SEFeb 27, 2021

A Differential Testing Approach for Evaluating Abstract Syntax Tree Mapping Algorithms

arXiv:2103.00141v12 citations
AI Analysis

This work addresses the lack of evaluation methods for AST mapping algorithms, which are foundational for analyzing source code changes, but it is incremental as it builds on existing algorithms without introducing a new mapping method.

The paper tackles the problem of evaluating the accuracy of abstract syntax tree (AST) mapping algorithms by proposing a hierarchical differential testing approach, achieving a precision of 0.98-1.00 and recall of 0.65-0.75 in expert validation, and identifying that state-of-the-art algorithms generate inaccurate mappings for 20-36% of file revisions in a large-scale study.

Abstract syntax tree (AST) mapping algorithms are widely used to analyze changes in source code. Despite the foundational role of AST mapping algorithms, little effort has been made to evaluate the accuracy of AST mapping algorithms, i.e., the extent to which an algorihtm captures the evolution of code. We observe that a program element often has only one best-mapped program element. Based on this observation, we propose a hierarchical approach to automatically compare the similarity of mapped statements and tokens by different algorithms. By performing the comparison, we determine if each of the compared algorithms generates inaccurate mappings for a statement or its tokens. We invite 12 external experts to determine if three commonly used AST mapping algorithms generate accurate mappings for a statement and its tokens for 200 statements. Based on the experts' feedback,we observe that our approach achieves a precision of 0.98--1.00 and a recall of 0.65--0.75. Furthermore, we conduct a large-scale study with a dataset of ten Java projects, containing a total of 263,165 file revisions. Our approach determines that GumTree, MTDiff and IJM generate inaccurate mappings for 20%--29%, 25%--36% and 21%--30% of the file revisions, respectively. Our experimental results show that state-of-art AST mapping agorithms still need improvements.

Code Implementations1 repo
Foundations

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

Your Notes