Req2Test-Bench / README.md
qibh's picture
Req2Test-Bench 1.1.0
0dfb049
|
Raw History Blame Contribute Delete
11.9 kB
metadata
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 | Paper | Leaderboard | Documentation

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:

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). The leaderboard is in 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 (code and steps), algorand/algorand-sdk-testing (features) MIT (both repositories)
coddy-agent (coddy-agent) 274 282 Go godog coddy-project/coddy-agent MIT
CoreShop (coreshop) 334 422 PHP Behat coreshop/CoreShop CoreShop Commercial License (CCL), with Pimcore under the Pimcore Open Core License (POCL)
e-petitions (e-petitions) 98 119 Ruby Cucumber alphagov/e-petitions MIT
Eclipse Kapua (kapua) 330 605 Java Cucumber eclipse-kapua/kapua EPL-2.0
PrestaShop (prestashop) 348 1,352 PHP Behat PrestaShop/PrestaShop OSL-3.0 (core), AFL-3.0 (modules)
python-docx (python-docx) 237 239 Python behave python-openxml/python-docx MIT
Sylius (sylius) 319 1,950 PHP Behat 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).

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). 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. req2test fetch downloads and verifies the release files of this repository.

The GitHub usage guide 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 describes how to run your own agent. Evaluation options, runs over several hosts and the cost per project are in docs/evaluation.md.

Licensing Information

The Req2Test-Bench code (GitHub) 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 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.

Citation Information

@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}
}