테스트를 프롬프트로: LLM 코드 생성을 위한 테스트 주도 개발 벤치마크
Tests as Prompt: A Test-Driven-Development Benchmark for LLM Code Generation
May 13, 2025
저자: Yi Cui
cs.AI
초록
우리는 테스트 주도 개발(TDD) 작업에서 대형 언어 모델(LLM)을 평가하기 위한 새로운 벤치마크인 WebApp1K를 소개합니다. 이 벤치마크에서는 테스트 케이스가 코드 생성을 위한 프롬프트와 검증 도구로 동시에 사용됩니다. 자연어 프롬프트에 의존하는 기존 접근 방식과 달리, 우리의 벤치마크는 LLM이 테스트 케이스로부터 기능을 직접 해석하고 구현하는 능력을 강조하며, 이는 실제 소프트웨어 개발 관행을 반영합니다. 20개의 애플리케이션 도메인에 걸쳐 1000개의 다양한 과제로 구성된 이 벤치마크는 LLM이 컨텍스트 길이와 다중 기능 복잡성의 제약 하에서 간결하고 기능적인 코드를 생성하는 능력을 평가합니다. 우리의 연구 결과는 TDD 성공에 있어 지시 사항 준수와 컨텍스트 내 학습이 일반적인 코딩 숙련도나 사전 학습 지식보다 더 중요한 능력임을 강조합니다. 19개의 최신 모델에 대한 포괄적인 평가를 통해, 긴 프롬프트에서의 지시 사항 손실과 같은 성능 병목 현상을 밝히고, 여러 근본 원인에 걸친 상세한 오류 분석을 제공합니다. 이 작업은 TDD 전용 벤치마크의 실용적 가치를 강조하며, 엄격한 애플리케이션 중심 코딩 시나리오에서 LLM 역량을 발전시키기 위한 기반을 마련합니다.
English
We introduce WebApp1K, a novel benchmark for evaluating large language models
(LLMs) in test-driven development (TDD) tasks, where test cases serve as both
prompt and verification for code generation. Unlike traditional approaches
relying on natural language prompts, our benchmark emphasizes the ability of
LLMs to interpret and implement functionality directly from test cases,
reflecting real-world software development practices. Comprising 1000 diverse
challenges across 20 application domains, the benchmark evaluates LLMs on their
ability to generate compact, functional code under the constraints of context
length and multi-feature complexity. Our findings highlight instruction
following and in-context learning as critical capabilities for TDD success,
surpassing the importance of general coding proficiency or pretraining
knowledge. Through comprehensive evaluation of 19 frontier models, we reveal
performance bottlenecks, such as instruction loss in long prompts, and provide
a detailed error analysis spanning multiple root causes. This work underscores
the practical value of TDD-specific benchmarks and lays the foundation for
advancing LLM capabilities in rigorous, application-driven coding scenarios.