A Novel Refactoring and Semantic Aware Abstract Syntax Tree Differencing Tool and a Benchmark for Evaluating the Accuracy of Diff Tools
ACM Transactions on Software Engineering and Methodology · 28.02.2025 · 34 (2) · 1-63
DOI: 10.1145/3696002 ↗Kurz gefasst
Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 24.01.2025. Verfasst von Pouria Alikhanifard und 1 weiteren Autor:innen. Die Arbeit wurde bisher 36-mal zitiert (Crossref) und nennt 67 Literaturangaben. Gefördert von: NSERC.
Abstract (Originalsprache)
Software undergoes constant changes to support new requirements, address bugs, enhance performance, and ensure maintainability. Thus, developers spend a great portion of their workday trying to understand and review the code changes of their teammates. Abstract Syntax Tree (AST) diff tools were developed to overcome the limitations of line-based diff tools, which are used by the majority of developers. Despite the notable improvements brought by AST diff tools in understanding complex changes, they still suffer from serious limitations, such as (1) lacking multi-mapping support, (2) matching semantically incompatible AST nodes, (3) ignoring language clues to guide the matching process, (4) lacking refactoring awareness, and (5) lacking commit-level diff support. We propose a novel AST diff tool based on RefactoringMiner that resolves all aforementioned limitations. First, we improved RefactoringMiner to increase its statement mapping accuracy, and then we developed an algorithm that generates AST diff for a given commit or pull request based on the refactoring instances and pairs of matched program element declarations provided by RefactoringMiner. To evaluate the accuracy of our tool and compare it with the state-of-the-art tools, we created the first benchmark of AST node mappings, including 800 bug-fixing commits and 188 refactoring commits. Our evaluation showed that our tool achieved a considerably higher precision and recall, especially for refactoring commits, with an execution time that is comparable with that of the faster tools.
Förderung
- NSERC
Zitieren
APA
Alikhanifard, P., & Tsantalis, N. (2025). A Novel Refactoring and Semantic Aware Abstract Syntax Tree Differencing Tool and a Benchmark for Evaluating the Accuracy of Diff Tools. ACM Transactions on Software Engineering and Methodology, 34(2), 1-63. https://doi.org/10.1145/3696002
Vancouver
Alikhanifard P, Tsantalis N. A Novel Refactoring and Semantic Aware Abstract Syntax Tree Differencing Tool and a Benchmark for Evaluating the Accuracy of Diff Tools. ACM Transactions on Software Engineering and Methodology. 2025;34(2):1-63. doi:10.1145/3696002
BibTeX
@article{Alikhanifard2025,
author = {Alikhanifard, Pouria and Tsantalis, Nikolaos},
title = {A Novel Refactoring and Semantic Aware Abstract Syntax Tree Differencing Tool and a Benchmark for Evaluating the Accuracy of Diff Tools},
journal = {ACM Transactions on Software Engineering and Methodology},
year = {2025},
volume = {34},
number = {2},
pages = {1--63},
doi = {10.1145/3696002}
}
EUVIMED