DiffFix: Incrementally Fixing AST Diffs via Context and Type Information
Guofeng Zeng, Chang-Ai Sun, Kai Gao, Huai Liu
摘要
The abstract syntax tree differencing (ASTDiff) technique aims to capture syntactic code changes through comparing the differences between a pair of ASTs of a program, which has been widely used in various program analysis or testing tasks, such as code review, clone detection, and regression testing. A key issue for ASTDiff lies in the accurate mappings between nodes of two ASTs. However, most existing approaches often fail to generate such perfect diffs due to the gap between diverse code changes and unsound node matching heuristics. Our in-depth investigation reveals that most inaccurate mappings are caused by the ignorance of context- and/or type-specific constraints. Accordingly, we propose an AST diff fixing approach DiffFix that leverages both the node’s context and type constraints to iteratively and incrementally fix imperfect diffs. Comprehensive experiments have been conducted to evaluate the effectiveness of DiffFix through its application to fix diffs generated by five state-of-the-art ASTDiff techniques. The experimental results demonstrate that DiffFix can improve the perfect diff rate of these baseline techniques by 5.25% to 51.12% with negligible time overhead.
问 Lune
几分钟看清这篇 Paper 的位置,不用再花一下午。
Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
相关 Paper
- iASTMapper: An Iterative Similarity-Based Abstract Syntax Tree Mapping AlgorithmNeng Zhang, Qinde Chen, Zibin Zheng, Ying ZouASE 2023 · 2 次引用
- A Differential Testing Approach for Evaluating Abstract Syntax Tree Mapping AlgorithmsYuanrui Fan, Xin Xia, David Lo, Ahmed E. Hassan 等ICSE 2021 · 18 次引用
- Fine-grained, accurate and scalable source differencingJean-Rémy Falleri, Matias MartinezICSE 2024 · 9 次引用
- TransplantFix: Graph Differencing-based Code Transplantation for Automated Program RepairDeheng Yang, Xiaoguang Mao, Liqian Chen, Xuezheng Xu 等ASE 2022 · 22 次引用
- Concise, type-safe, and efficient structural diffingSebastian Erdweg, Tamás Szabó, André PacakPLDI 2021 · 6 次引用
