SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents

Niels Mündler, Mark Niklas Müller, Jingxuan He, Martin T. Vechev

arXiv:2406.12952 · 2026-07-27 공개 · arXiv · PDF

llm-evaluation code-agents github-repositories test-generation swe-agent code-repair bug-fixing software-testing

Abstract

Rigorous software testing is crucial for developing and maintaining high-quality code, making automated test generation a promising avenue for both improving software quality and boosting the effectiveness of code generation methods. However, while code generation with Large Language Models (LLMs) is an extraordinarily active research area, test generation remains relatively unexplored. We address this gap and investigate the capability of LLM-based Code Agents to formalize user issues into test cases. To this end, we propose a novel benchmark based on popular GitHub repositories, containing real-world issues, ground-truth bug-fixes, and golden tests. We find that LLMs generally perform surprisingly well at generating relevant test cases, with Code Agents designed for code repair exceeding the performance of systems designed specifically for test generation. Further, as test generation is a similar but more structured task than code generation, it allows for a more fine-grained analysis using issue reproduction rate and coverage changes, providing a dual metric for analyzing systems designed for code repair. Finally, we find that generated tests are an effective filter for proposed code fixes, doubling the precision of SWE-Agent. We release all data and code at https://github.com/logic-star-ai/SWT-Bench

한국어 요약

한 줄 요약

SWT-Bench를 통해 코드 에이전트가 생성한 테스트가 버그 수정의 정확도를 2배로 높인다.

핵심 기여도

핵심 아이디어

SWT-Bench는 실제 GitHub 이슈와 버그 패치를 기반으로, 코드 에이전트가 테스트를 생성하는 능력을 평가하는 데 초점을 맞춘다. 기존 연구는 코드 생성에 집중했지만, 테스트 생성은 상대적으로 탐구되지 않았다. 본 연구는 테스트 생성이 코드 생성보다 구조화되어 있어, 이슈 재현률과 커버리지 변화를 통해 코드 수정 시스템을 더 정밀하게 분석할 수 있음을 제시한다. 특히, 생성된 테스트가 코드 수정의 정확도를 측정하는 신뢰할 수 있는 지표가 될 수 있다는 점이 핵심 통찰이다.

기술적 접근법

주요 결과

의의 및 한계

SWT-Bench는 테스트 생성과 코드 수정을 결합한 새로운 평가 기준을 제시하며, 코드 에이전트의 실용성을 검증하는 데 기여한다. 특히, 생성 테스트가 코드 수정의 정확도를 측정하는 신뢰도 높은 지표가 될 수 있음을 보여준다. 그러나, Python에만 초점이 맞춰져 있고, 대규모 데이터셋의 일반화 가능성은 추가 연구가 필요하다. 또한, 테스트 생성의 질에 따라 성능 차이가 크므로, 향후 테스트 생성의 질 향상 연구가 필요하다.

실용적 활용

SWT-Bench는 코드 에이전트의 테스트 생성 능력을 평가하는 데 활용될 수 있으며, 소프트웨어 품질 향상, 개발자 생산성 증대, 자동 코드 수정 도구 개선 등 다양한 산업 및 연구 분야에서 적용 가능하다.