Datasets:
File size: 8,801 Bytes
065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f 0190001 065ea6f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | ---
license: cc-by-4.0
language:
- en
task_categories:
- text-generation
tags:
- code
- software-engineering
- test-evolution
- unit-testing
- benchmark
- java
- coding-agents
size_categories:
- n<1K
pretty_name: TEBench
configs:
- config_name: default
data_files:
- split: test
path: data/test.parquet
---
# TEBench: Project-Level Test Evolution Benchmark
π **Paper:** https://arxiv.org/abs/2605.06125 | π» **Code:** https://github.com/iSEngLab/TEBench
**TEBench** is the first **project-level** benchmark for *test evolution*: given a
project repository and a commit that changes production code, a system must
**autonomously** (1) identify which existing tests need to be modified and where
new tests are needed, and (2) produce the corresponding test patch. Unlike prior
method-level benchmarks that pre-pair a changed method with its test
(`β¨m, m', tβ©`), TEBench requires reasoning across the whole project.
The benchmark contains **314 task instances from 10 real-world Java/Maven
projects** in the Defects4J ecosystem, each annotated with one or more of three
evolution types and accompanied by **developer-written ground-truth test
patches**.
## Evolution Types
| Type | Definition |
|------|------------|
| **Breaking** | An existing test fails to compile/run after the code change; the developer modifies it to restore correctness. |
| **Stale** | An existing test still passes after the change but no longer meaningfully validates the new behavior; the developer updates it anyway. |
| **Missing** | The developer adds a **new** test to cover behavior introduced/exposed by the change. |
A task may carry multiple types simultaneously.
## The Three-Version Structure
Each instance is built around three versions of the project:
- **Vβ1** (`v_minus_1_commit`) β parent commit, before any change.
- **Vβ0.5** β Vβ1 **plus all non-test changes** from the commit (production code,
build config, resources), with the **original tests untouched**. Vβ0.5 is *not*
a commit; it is reconstructed by applying `source_patch` to Vβ1. This is the
state given to the system: *the source has moved on, the tests have not.*
- **V0** (`v0_commit`) β the full commit including the developer's actual test
changes. This is the **ground truth**.
In this dataset:
- `source_patch` applies to **Vβ1** and reconstructs **Vβ0.5** (the system input).
- `test_patch` is the **gold answer**: the developer's test changes (Vβ0.5 β V0).
Both patches were generated with `git diff --binary --full-index` and are verified
to apply cleanly to `v_minus_1_commit` with `git apply` (see `validate_patches.py`):
**314/314 source patches and 314/314 test patches apply.**
## Data Fields
| Field | Type | Description |
|-------|------|-------------|
| `instance_id` | string | Stable id, `<project>__<short_hash>`. |
| `project` | string | Project name. |
| `repo` | string | Upstream GitHub slug (e.g. `apache/commons-lang`). |
| `v_minus_1_commit` | string | **Vβ1** commit hash (parent state, before the change). |
| `v0_commit` | string | **V0** commit hash (full ground-truth commit). |
| `v0_date` | string | V0 commit date. |
| `v0_message` | string | V0 commit message. |
| `labels` | list[string] | Evolution types: `breaking` / `stale` / `missing` (β₯1 per task). |
| `changed_test_methods` | list[string] | GT modified/added test methods (`Class.method`). |
| `new_test_files` | list[string] | Test files where GT adds new methods. |
| `new_test_methods` | string | JSON map `{TestClass: [methods]}` of GT-added methods. |
| `num_changed_files` | int | Files changed in the commit. |
| `src_changed_lines` | int | Production lines changed. |
| `test_changed_lines` | int | Test lines changed. |
| `source_patch` | string | **Vβ1 β Vβ0.5** diff (non-test; given to the system). |
| `test_patch` | string | **Vβ0.5 β V0** diff (gold test changes). |
There is a single **`test`** split with 314 instances.
## Usage
```python
from datasets import load_dataset
ds = load_dataset("iSEngLab/TEBench", split="test")
ex = ds[0]
print(ex["instance_id"], ex["labels"])
```
Reconstruct the agent input (Vβ0.5) for an instance:
```bash
git clone https://github.com/<repo>.git && cd <repo>
git checkout <v_minus_1_commit>
git apply source.patch # now at V-0.5: new source, old tests
# ... system produces test changes ...
git apply test.patch # gold V0 test changes, for reference/eval
```
## Evaluation
TEBench evaluates two dimensions (full harness and Docker image referenced below):
- **Identification** β Precision / Recall / F1 of the test methods the system
modifies/adds vs. the ground truth. Modified/deleted tests are matched at
**method** granularity; newly added tests at **file** granularity.
- **Update** β a composite of **executability** (compiles & passes),
**coverage overlap** with GT on the changed production methods (line + branch),
and **modification similarity** (token Jaccard vs. GT). Executability gates the
score: non-compiling updates score 0.
## Dataset Statistics
| Project | Tasks | Breaking | Stale | Missing |
|---------|------:|---------:|------:|--------:|
| commons-cli | 18 | 8 | 12 | 9 |
| commons-codec | 19 | 12 | 11 | 12 |
| commons-collections | 23 | 10 | 14 | 15 |
| commons-compress | 86 | 34 | 58 | 53 |
| commons-csv | 31 | 22 | 18 | 16 |
| commons-lang | 69 | 28 | 46 | 40 |
| commons-math | 8 | 8 | 3 | 2 |
| gson | 1 | 1 | 0 | 1 |
| jfreechart | 3 | 1 | 3 | 1 |
| jsoup | 56 | 48 | 42 | 50 |
| **Total** | **314** | **172** | **207** | **199** |
**Label distribution** (a task may carry several types, so shares do not sum to 100%):
| Type | Tasks | Share of 314 |
|------|------:|-------------:|
| Breaking | 172 | 54.8% |
| Stale | 207 | 65.9% |
| Missing | 199 | 63.4% |
- **Multi-label:** 219 tasks (69.7%) carry β₯2 types; 45 (14.3%) carry all three;
95 (30.3%) are single-type.
- **Complexity (median):** 4 changed files, 34 source lines, ~32 test lines changed.
## Construction
Built via a four-stage filtering pipeline over the Defects4J ecosystem:
67,670 commits (14 Maven projects) β static filtering (post-2019, co-modification
of `src/main` and `src/test`, real method-body changes) β 6,169 β execution-based
validation (isolated worktrees, Maven Surefire + JaCoCo) β 561 β quality filtering
(no merges, 5β200 test lines changed, method-level dedup) β **314 instances / 10
projects**.
## Companion Artifacts
- **Evaluation harness & code:** https://github.com/iSEngLab/TEBench β
identification & update scoring, baselines, dataset build scripts.
- **Reproducible environment:** a prebuilt Docker image, shipped as
`docker/tebench-env.tar` in this repository (see below).
## Docker Environment
The Docker image bundles everything needed to run and evaluate TEBench β all 10
project repositories, Maven 3.6.3, OpenJDK 8 / 11 / 17 (default JDK 8), and the
evaluated coding agents (Claude Code, Codex CLI, OpenCode CLI) β so you do not
have to configure per-project toolchains.
The image archive (`docker/tebench-env.tar`) is stored in this dataset repo as an
LFS file. HuggingFace is **not** a container registry, so you download the tar and
load it locally:
```bash
# 1. Download the image archive from this dataset repo
hf download iSEngLab/TEBench docker/tebench-env.tar --repo-type=dataset --local-dir .
# 2. Load it into your local Docker
docker load -i docker/tebench-env.tar
# 3. Start a container
docker run --rm -it tebench-env
# 4. Inside the container
cd /root/TestUpdate
java -version && mvn -version # JDK 8 + Maven 3.6.3
claude --version && codex --version && opencode --version
```
Switch JDK inside the container via `JAVA_HOME` (`JAVA11_HOME`, `JAVA17_HOME` are
also available). Agent worktrees are large derived artifacts and are **not**
bundled; regenerate them inside the container with the harness when needed.
## Licensing
- **Annotations / patch metadata in this dataset:** CC-BY-4.0.
- **Embedded source code** inside `source_patch` / `test_patch` remains under the
**original license of each upstream project** and must be used accordingly:
| Project(s) | License |
|------------|---------|
| commons-* (cli, codec, collections, compress, csv, lang, math), gson | Apache-2.0 |
| jsoup | MIT |
| jfreechart | LGPL-2.1 |
Attribution to the original authors is preserved through commit hashes and the
`repo` field. Redistribution of the Docker image (which contains full source
trees) must likewise honor these licenses.
## Citation
```bibtex
@article{tebench,
title = {TEBench: Benchmarking LLM Agents on Project-Level Test Evolution},
journal = {arXiv preprint arXiv:2605.06125},
year = {2026},
url = {https://arxiv.org/abs/2605.06125}
}
```
|