atlas

Research map / Large language models / Agents, code and math

TestGenEval: A Real World Unit Test Generation and Test Completion Benchmark

ICLR 2025 · Large language models › Agents, code and math · approach: Execution-based code verification · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces TestGenEval, a benchmark built from SWE-bench repositories for file-level unit test suite generation and test completion, scored with pass@k, coverage and mutation score, and evaluates 9 open and closed LLMs.

Problem

Existing test generation benchmarks are small, self-contained, use equivalence tests rather than human-written tests, rarely report coverage or mutation score, and do not evaluate test completion on real repositories.

Approach

Adapts SWE-bench Docker environments of 11 large Python repositories into file-level test generation and test completion tasks (first, last, extra tests), with human-written gold tests, and scores generated tests by coverage and mutation score (cosmic-ray) in addition to pass rates.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use GPT-4o rather than Llama 3.1 405B for full test suite generationFull test suite generation · TestGenEvalcoverage: 35.0% -> 35.2%Helped
Use GPT-4o rather than Llama 3.1 405B for full test suite generationFull test suite generation · TestGenEvalmutation score: 16.4% -> 18.8%Helped
Increase model size within the Llama 3.1 family from 8B to 70BLlama 3.1 test generation · TestGenEval full test generationAny Pass@1: 30.5% -> 60.7%Helped
Increase model size within the Gemma family from 9B to 27BGemma test generation · TestGenEval full test generationAny Pass@1: 42.1% -> 57.7%Helped
Provide more of the test file as contextTest completion · TestGenEvalPass@5Helped
Increase context length for test completion up to around 32k tokensTest completion · TestGenEvalPass@5Helped
Increase context length for full test generationFull test generation · TestGenEvalcoverageNo clear effect
Sample more candidate test suitesLlama 3.1 8B · TestGenEval full test generationcoverage@kHelped
Sample more test completions, particularly the first fiveLlama 3.1 8B · TestGenEval test completionPass@kHelped
Generate the last or extra test rather than the first testTest completion · TestGenEvalcoverage improvementHurt
Use Codestral 22B rather than other evaluated models for last-test completionTest completion · TestGenEvalPass@5: 74.3%Helped

Surprising findings

Limitations

Experimental setup

Datasets: SWE-bench

Benchmarks: TestGenEval TestGenEvalLite

Metrics: all pass@1 any pass@1 coverage coverage@pass mutation score mutation score@pass pass@1 pass@5 coverage improvement

Baselines: TestEval HumanEval SWT-Bench R2E

Builds on: SWE-bench TestEval R2E cosmic-ray

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy