SWE-Refactor: A Repository-Level Benchmark for Real-World LLM-Based Code Refactoring
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have recently attracted wide interest for tackling software engineering tasks. In contrast to code generation, refactoring demands precise, semantics-preserving edits that improve program structure, which also makes automated evaluation challenging. However, existing refactoring benchmarks commonly suffer from three shortcomings: limited coverage of refactoring scenarios, the inclusion of instances that mix refactoring with unrelated changes, and insufficient repository-level context for realistic assessment. To mitigate these issues, we introduce SWE-Refactor, a new benchmark for LLM-based code refactoring. SWE-Refactor comprises 1,099 developer-written, behavior-preserving refactorings mined from 18 Java projects, including 922 atomic and 177 compound instances. Each instance is validated via compilation, test execution, and automated refactoring detection tools to ensure correctness. We evaluate nine widely used LLMs on SWE-Refactor, covering models such as GPT-4o-mini, DeepSeek-V3, and CodeLLaMa, to provide representative reference results. Our results show that complex and compound refactorings remain the primary source of failures; notably, an OpenAI Codex agent achieves only 39.4% success on compound instances. We release SWE-Refactor and all evaluation results to facilitate future research on LLM-based code refactoring.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). First posted on arXiv 3 Feb 2026.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 11.
11 papers.
- 2026LLMs Corrupt Your Documents When You Delegatecited by 9
- 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?cited by 8
- 2026SWE Atlas: Benchmarking Coding Agents Beyond Issue Resolutioncited by 6
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 5
- 2026SWE-Hub: A Unified Production System for Scalable, Executable Software Engineering Taskscited by 4
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026RepoProbe: Benchmarking Architecture-Aware Repository Comprehension with Checklistscited by 2
- 2026SmellBench: Towards Fine-Grained Evaluation of Code Agents on Refactoring Taskscited by 0
- 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoringcited by 0
- 2026RefactorPlatform: An Open-Source Harness for Controlled Evaluation of Repository-Scale Refactoring Agentscited by 0
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skillscited by 0
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skills10 Sep 2026
- 2026RefactorPlatform: An Open-Source Harness for Controlled Evaluation of Repository-Scale Refactoring Agents4 Sep 2026
- 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring21 Aug 2026
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring10 Aug 2026
- 2026RepoProbe: Benchmarking Architecture-Aware Repository Comprehension with Checklists5 Aug 2026
- 2026SmellBench: Towards Fine-Grained Evaluation of Code Agents on Refactoring Tasks4 Jun 2026
- 2026SWE Atlas: Benchmarking Coding Agents Beyond Issue Resolution8 May 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026LLMs Corrupt Your Documents When You Delegate17 Apr 2026
- 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?4 Mar 2026
- 2026SWE-Hub: A Unified Production System for Scalable, Executable Software Engineering Tasks28 Feb 2026