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.
问问这篇 Paper
问问你的智能体。
Lune 读过与它相关的顶会 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 次
- DSFM: Enhancing Functional Code Clone Detection with Deep Subtree InteractionsZhiwei Xu, Shaohua Qiang, Dinghong Song, Min Zhou 等ICSE 2024 · 被引用 7 次
