SWE Refactor Bench: Can Coding Agents Complete a Long-Horizon, Whole-Repository Stack Migration?

Deyao Hong, Yizhe Chi, Wenyi Li, Xiaoqiu Wang, Mingju Gao, Kaisen Yang, Bingxiang He, Youjie Zheng, Calvin Xiao, Qinhuai Na

arXiv:2608.23564 · 2026-08-30 공개 · arXiv · PDF

model-evaluation coding-agents agentic-verification swe-refactor-bench technical-debt migration-audit behavioral-tests whole-repository

Abstract

Modern software systems accumulate technical debt over decades of development, which makes migration expensive and largely manual. As coding agents become increasingly capable at bug fixing, can they autonomously perform such migrations? Existing benchmarks cannot answer this question because they evaluate only behavioural correctness, not whether the migration actually occurred. This leads an easy hack: agents copy the original implementation to make tests pass. We call this Blindness. To address this problem, we introduce SWE Refactor Bench, a benchmark comprising 20 whole-repository migrations, covering 4 kinds of technical debt. A three-stage evaluation protocol measures both migration completeness and behavioural correctness. (1) Migration Audit verifies that the migration occurred. (2) Behavioural Tests measure correctness with a fixed test suite. (3) Agentic Verification uses 6 independent coding agents to generate targeted tests for hidden behavioural differences. Across 520 runs from 8 frontier models and 26 model-effort configurations, only 28 of 520 runs (5.4%) pass all three stages, 13 of the 20 tasks receive no accepted solution, and the best model (claude-opus-5) scores 47.0/100. Migration completeness and behavioural correctness are distinct abilities: a few runs preserve behaviour by skipping the migration and are stopped at Migration Audit; most attempt it and break behaviour, and are stopped at Behavioural Tests. Agents cannot deliver a perfect migration: among the 340 runs that pass Migration Audit, 58% reach 99% of the fixed checks, yet only 26% reach 100%. Agent capability differs across migration categories: agents score 31.4 on build toolchain rewrites but only 5.6 on language rewrites. Together, these findings position SWE Refactor Bench as a rigorous testbed for developing coding agents for reliable whole-repository migrations.

한국어 요약

한 줄 요약

SWE Refactor Bench는 코드 생성 에이전트가 전체 레포지토리 마이그레이션을 완료할 수 있는지 평가하는 3단계 벤치마크로, 5.4%만 모든 단계를 통과했다.

핵심 기여도

핵심 아이디어

기존 벤치마크는 테스트 성공 여부만 평가해, 코드가 실제로 변경되었는지 확인하지 못하는 **Blindness** 문제가 발생한다. 이를 해결하기 위해 **SWE Refactor Bench**는 3단계 평가 프로토콜을 도입한다. 첫 번째 단계인 **Migration Audit**은 마이그레이션이 실제로 이루어졌는지 코드 수준에서 검증하며, 두 번째 단계인 **Behavioural Tests**는 130,118개의 고정된 테스트를 통해 동작 정확도를 평가한다. 마지막 단계인 **Agentic Verification**은 6개의 독립적인 코드 생성 에이전트가 제출된 코드와 원본 코드를 비교해 숨겨진 동작 차이를 탐지한다. 이는 단순히 테스트를 통과하는 것이 아니라, 실제 시스템 동작이 유지되었는지를 확인하는 데 기여한다.

기술적 접근법

주요 결과

의의 및 한계

SWE Refactor Bench는 코드 생성 에이전트가 전체 레포지토리 마이그레이션을 안정적으로 수행할 수 있는지 평가하는 첫 번째 3단계 벤치마크로, 기술 부채 해결의 학술적·실용적 가치를 제공한다. 특히, **Blindness** 문제를 명확히 지적하고 이를 해결하기 위한 평가 프로토콜을 제안한 점에서 의의가 있다. 그러나 현재 에이전트는 5.4%의 성공률에 그치며, 특히 언어 리라이트와 같은 복잡한 작업에서는 성능이 저조하다는 한계가 있다. 또한, 13개의 태스크는 아무런 해결책도 제시되지 않았으며, 이는 마이그레이션의 난이도가 모델에 따라 크게 달라질 수 있음을 시사한다.

실용적 활용

SWE Refactor Bench는 코드 생성 에이전트의 장기적, 대규모 시스템 유지보수 능력을 평가하는 데 활용될 수 있다. 특히, 빌드 툴체인 변경이나 언어 리라이트와 같은 고비용 작업을 자동화하려는 소프트웨어 엔지니어링 팀이나 연구자에게 유용할 수 있다. 이 벤치마크는 에이전트가 단순히 테스트를 통과하는 것이 아니라, 실제 시스템 구조를 변경하면서도 동작을 유지할 수 있는지 평가하는 데 기여한다.