--- 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` | 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/.git && cd git checkout 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} } ```