File size: 11,878 Bytes
0dfb049
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
pretty_name: Req2Test-Bench
license: other
license_name: req2test-bench-mixed
license_link: https://github.com/code-philia/Req2Test-Bench/blob/main/LICENSE
language:
- en
size_categories:
- 1K<n<10K
task_categories:
- text-generation
tags:
- code
- software-engineering
- software-testing
- test-generation
- bdd
- gherkin
- mutation-testing
- benchmark
configs:
- config_name: default
  default: true
  data_files:
  - split: eval
    path: data/eval-*.parquet
  - split: full
    path: data/full-*.parquet
- config_name: gt_tests
  data_files:
  - split: full
    path: gt_tests/full-*.parquet
---

# Req2Test-Bench

[Code](https://github.com/code-philia/Req2Test-Bench) | [Paper](https://arxiv.org/abs/2610.36584) | [Leaderboard](https://github.com/code-philia/Req2Test-Bench/blob/main/results/leaderboard.md) | [Documentation](https://github.com/code-philia/Req2Test-Bench/tree/main/docs)

## Dataset Summary

Req2Test-Bench is a benchmark for **requirement-to-test generation** in real software projects. It collects 5,086 execution-validated instances from 8 real-world projects in 5 programming languages. Its `eval` split has 2,051 instances.

Each instance is one Scenario of a project's Gherkin requirements. An agent receives the Requirement (a Gherkin Feature with one target Scenario), the production interfaces that the Scenario targets, and a runnable workspace of the project: its source with the target implementation hidden, and an application runtime in which the project's tests can be run. It must write the Scenario's executable Test Implementation: its Step Definitions and the helper code they need.

Req2Test-Bench runs the generated test against the project's real code and asks two questions. Does it pass? And does it fail on every *mutant* (a copy of the code with one injected fault) that the developers' own test of that Requirement catches? A test that passes and kills all of those mutants is *KillComplete*.

To load the tasks and the reference tests:

```python
from datasets import load_dataset
eval_rows = load_dataset("code-philia/Req2Test-Bench", split="eval")
gt = load_dataset("code-philia/Req2Test-Bench", "gt_tests", split="full")
```

## Supported Tasks and Leaderboards

The metrics are Pass@1, **KillComplete@1**, mutant-kill recall, API F1 and coverage Jaccard ([docs/metrics.md](https://github.com/code-philia/Req2Test-Bench/blob/main/docs/metrics.md)). The leaderboard is in [results/leaderboard.md](https://github.com/code-philia/Req2Test-Bench/blob/main/results/leaderboard.md).

## Languages

The requirements are Gherkin Features written in English. The projects are written in Go, Java, PHP, Python and Ruby. Their tests use the BDD frameworks behave (Python), Cucumber (Java and Ruby), Behat (PHP) and godog (Go).

| Project (`project`) | Eval | Full | Language | Framework | Upstream repository | Upstream licence |
|---|---:|---:|---|---|---|---|
| Algorand Java SDK (`algorand-sdk`) | 111 | 117 | Java | Cucumber | [algorand/java-algorand-sdk](https://github.com/algorand/java-algorand-sdk) (code and steps), [algorand/algorand-sdk-testing](https://github.com/algorand/algorand-sdk-testing) (features) | MIT (both repositories) |
| coddy-agent (`coddy-agent`) | 274 | 282 | Go | godog | [coddy-project/coddy-agent](https://github.com/coddy-project/coddy-agent) | MIT |
| CoreShop (`coreshop`) | 334 | 422 | PHP | Behat | [coreshop/CoreShop](https://github.com/coreshop/CoreShop) | [CoreShop Commercial License (CCL)](https://github.com/coreshop/CoreShop/blob/05bf7af946c919896d0807e4f0c7af37f446653b/LICENSE.md), with Pimcore under the [Pimcore Open Core License (POCL)](https://github.com/pimcore/pimcore/blob/355ac351e1a672e92246b2cd54763bfa59158cb4/LICENSE.md) |
| e-petitions (`e-petitions`) | 98 | 119 | Ruby | Cucumber | [alphagov/e-petitions](https://github.com/alphagov/e-petitions) | MIT |
| Eclipse Kapua (`kapua`) | 330 | 605 | Java | Cucumber | [eclipse-kapua/kapua](https://github.com/eclipse-kapua/kapua) | EPL-2.0 |
| PrestaShop (`prestashop`) | 348 | 1,352 | PHP | Behat | [PrestaShop/PrestaShop](https://github.com/PrestaShop/PrestaShop) | OSL-3.0 (core), AFL-3.0 (modules) |
| python-docx (`python-docx`) | 237 | 239 | Python | behave | [python-openxml/python-docx](https://github.com/python-openxml/python-docx) | MIT |
| Sylius (`sylius`) | 319 | 1,950 | PHP | Behat | [Sylius/Sylius](https://github.com/Sylius/Sylius) | MIT |
| **Total** | **2,051** | **5,086** | | | | |

Each project is pinned to one upstream commit (`base_commit`).

## Dataset Structure

### Data Fields

Default config (`eval`, `full`):

| Field | Type | Description |
|---|---|---|
| `instance_id` | string | The stable key, `<project>/<feature file path>:<Scenario line>`. |
| `project` | string | One of `algorand-sdk`, `coddy-agent`, `coreshop`, `e-petitions`, `kapua`, `prestashop`, `python-docx`, `sylius`. |
| `language` | string | `go`, `java`, `php`, `python` or `ruby`. |
| `framework` | string | The BDD runner: `godog`, `cucumber` (Java and Ruby), `behat` or `behave`. |
| `repo_url` | string | The upstream repository of the project snapshot the test runs against. |
| `base_commit` | string | The 40-character commit of `repo_url` that pins the snapshot. |
| `feature_repo_url` | string | The repository holding the `.feature` file. It equals `repo_url` except for `algorand-sdk`, whose features live in `algorand/algorand-sdk-testing`. |
| `feature_commit` | string | The commit of `feature_repo_url`. |
| `feature.file_path` | string | The path of the `.feature` file in `feature_repo_url`. |
| `feature.title` | string | The text after `Feature:`. |
| `feature.narrative` | string or null | The Feature's free-text description as written. Null when the Feature has a title only. |
| `feature.background` | string or null | The Feature's `Background:` block, or null. Its Steps run before the Scenario's. |
| `scenario.title` | string | The text after `Scenario:` or `Scenario Outline:`. |
| `scenario.line` | int64 | The 1-based line of the Scenario header in `feature.file_path`. |
| `scenario.kind` | string | `scenario` or `outline`. An Outline is one instance, and all its Examples rows run. |
| `scenario.tags` | list of string | The tags in effect for the Scenario (Feature and Scenario tags). |
| `scenario.gherkin` | string | The exact Scenario text from its header through its last Step or Examples row. With `feature.*` it forms the Requirement. |
| `requirement_richness` | string | The kind of Feature description: `user_story`, `prose` or `title_only`. |
| `target_interfaces` | list of {declaration, key} | The first-party public production methods that the ground-truth test calls directly from its When and Then Steps. `declaration` is the declaration text shown to agents. `key` identifies the method (2 or 3 strings, by language). |
| `target_interfaces_empty_reason` | string or null | Null when `target_interfaces` is non-empty. `no_action_or_check_call` when the action and check Steps call no production method directly. `not_identified: ...` for 6 rows of `algorand-sdk` outside `eval`. |
| `test_level` | string | `component`, `integration` or `system`. |
| `test_level_class` | string | The Step Definition suite class the level was assigned from, for example `KP-UNIT`. |
| `in_eval_split` | bool | True for the instances of `eval`. |
| `gt_test_files` | list of string | The paths (relative to `repo_url` at `base_commit`) of the ground-truth Test Implementation files. Their contents are in the `gt_tests` config. |

`gt_tests` config:

| Field | Type | Description |
|---|---|---|
| `project` | string | As above. |
| `instance_id` | string | Joins to the default config. |
| `files` | list of {path, content} | One entry per `gt_test_files` path, in the same order. `content` is the file's full UTF-8 text at `base_commit`. |
| `di_fragment` | string or null | CoreShop and Sylius only. The JSON text of the per-instance Symfony service definitions (service id, class, arguments, tags) that register the instance's Behat contexts. Null for the other projects. |

### Data Splits

| Config | Split | Rows | Contents |
|---|---|---:|---|
| `default` | `eval` | 2,051 | The benchmark instances. The metrics count 2,037 of them (see below). |
| `default` | `full` | 5,086 | Every execution-validated instance, `eval` included. |
| `gt_tests` | `full` | 5,086 | The ground-truth Test Implementation of every `full` instance. It is the reference answer, not model input. |

The `eval` rows are the `full` rows with `in_eval_split: true`, in the same order. For every project except python-docx, `full` is analysis data that `req2test` does not evaluate.

The metrics leave out 14 CoreShop and Sylius `eval` instances whose target has no code to hide, or whose ground-truth test passes even with the target hidden ([population](https://github.com/code-philia/Req2Test-Bench/blob/main/docs/evaluation.md#population)).

> [!WARNING]
> Keep the reference data away from the agent under test. The `gt_tests` config, the `base.tar.zst` view archives and the kits hold the answer or the unhidden code. Give an agent only the materialized view of its instance.

### Release Files

`releases/<tag>/` holds the files that `req2test fetch` downloads and verifies (7.2 GB): the dataset as JSONL, and per project an evaluation kit, the source views and a runtime pack ([docs/kits.md](https://github.com/code-philia/Req2Test-Bench/blob/main/docs/kits.md)). The kits take 3.8 GB, including the MySQL image that the CoreShop and Sylius kits share. The runtime packs take 3.3 GB, the source views 59 MB and the dataset 1.5 MB. The dataset viewer and `load_dataset` do not read this folder.

## How to Evaluate

The `req2test` command-line tool, its requirements and its installation are on [GitHub](https://github.com/code-philia/Req2Test-Bench#️-set-up). `req2test fetch` downloads and verifies the release files of this repository.

The GitHub [usage guide](https://github.com/code-philia/Req2Test-Bench#-usage) shows how to prepare the tasks, run an agent on them and evaluate its predictions, with an example that runs Codex CLI. [docs/agents.md](https://github.com/code-philia/Req2Test-Bench/blob/main/docs/agents.md) describes how to run your own agent. Evaluation options, runs over several hosts and the cost per project are in [docs/evaluation.md](https://github.com/code-philia/Req2Test-Bench/blob/main/docs/evaluation.md).

## Licensing Information

The Req2Test-Bench code ([GitHub](https://github.com/code-philia/Req2Test-Bench)) and the benchmark metadata authored for it (instance identifiers, target interfaces, labels, splits, mutant selections and kill sets) are released under the MIT licence.

Task content is derived from the upstream projects listed under [Languages](#languages) and stays under each project's own licence. This covers the requirements (Gherkin text), source snapshots and views, ground-truth tests, and mutants. The Docker images in the kits and the runtime packs contain third-party software (operating-system packages, language runtimes, build tools, databases such as MySQL Community Server and PostgreSQL, and each project's dependencies) under their own licences.

CoreShop content, including its kit, views and runtime pack, is under the CoreShop Commercial License and requires Pimcore under the Pimcore Open Core License. The terms are summarised in [NOTICE.md](https://github.com/code-philia/Req2Test-Bench/blob/main/NOTICE.md#coreshop).

## Citation Information

```bibtex
@misc{req2testbench2026,
  title         = {Benchmarking {LLM} Agents for Behaviorally Adequate Test Generation from Software Requirements},
  author        = {Qi, Binhang and Liu, Yiming and Lin, Yun and Zhou, Yangjie and Sun, Hailong and Dong, Jin Song},
  year          = {2026},
  eprint        = {2610.36584},
  archivePrefix = {arXiv},
  primaryClass  = {cs.SE}
}
```