Cross-Refactoring-Type Test Program Migration for Refactoring Engines
Chunhao Dong, Yanjie Jiang, Yang Zhang, Yuxia Zhang, Hui Liu
Abstract
Refactoring engines are an essential part of modern IDEs, supporting automated or semi-automated software refactorings. However, these refactoring engines suffer from software bugs, just like other complex software systems, and buggy refactoring engines may silently inject fatal errors into software projects. Consequently, thorough testing of refactoring engines is highly desirable. To this end, this paper proposes an automated approach called EngineTest to test refactoring engines. Unlike existing approaches, it is the first in this line to leverage both LLMs and bug reports of refactoring types other than the targeted refactoring type. The key rationale is that the same mistake, e.g., ignoring the potential name shadowing, may result in similar errors in multiple refactoring types.Consequently, we may retrieve a bug report for a refactoring type and carefully construct a few-shot example as input, guiding LLMs to migrate it into test programs for exercising other refactoring types.Finally, we run the test cases and validate them with differential testing and LLM-based inconsistent checking. We evaluate the proposed approach with widely used state-of-the-practice refactoring engines in Eclipse, NetBeans, and IntelliJ IDEA. Our evaluation results demonstrate that a total of 85 previously unknown bugs (including Java, C/C++, and Python) have been identified, and 30 of them have been manually confirmed by the tool vendors.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get ca693e44-aeb9-4066-8678-35728684be0bRelated papers
- Chatgpt-Based Test Generation for Refactoring Engines Enhanced by Feature Analysis on ExamplesChunhao Dong, Yanjie Jiang, Yuxia Zhang, Yang Zhang et al.ICSE 2025 · 4 citations
- Testing Method Relocation Algorithms via Template-Based Systematic Structural Traversal and Precondition FilteringChunhao Dong, Yanjie Jiang, Yang Zhang, Hui LiuISSTA 2026
- An Automated Approach to Extracting Local VariablesXiaye Chi, Hui Liu, Guangjie Li, Weixiao Wang et al.FSE 2023 · 8 citations
- RefAgent: A Multi-agent LLM-based Framework for Automatic Software RefactoringKhouloud Oueslati, Maxime Lamothe, Foutse KhomhICSE 2026 · 1 citation
- Context-Aware Name Recommendation for Field RenamingChunhao Dong, Yanjie Jiang, Nan Niu, Yuxia Zhang et al.ICSE 2024 · 4 citations
