Robert C. Martin Acceptance Pipeline Best Practices
Language-neutral specification for a portable acceptance-test pipeline: Gherkin feature files to JSON IR to generated acceptance tests to mutation testing. Based on Robert C. Martin's Acceptance Pipeline Specification. Contains ~50 rules across 14 categories, prioritized by impact.
When to Apply
Reference these rules when:
- Building a Gherkin parser that outputs JSON IR
- Implementing an acceptance test generator from JSON IR
- Writing an acceptance runtime that expands scenarios and dispatches steps
- Implementing mutation testing for acceptance test example values
- Setting up the full pipeline (parser, generator, runner, mutator) in a new project
- Debugging pipeline failures (parse errors, generation issues, mutation classification)
Pipeline Overview
The pipeline has two modes:
Normal acceptance run:
feature file -> gherkin parser -> JSON IR -> acceptance generator -> generated tests -> test runner
Mutation run:
feature file -> gherkin parser -> base JSON IR -> mutator (one changed IR per mutation)
-> generator (tests per mutation) -> test runner (evaluate each) -> mutation report
The normal run proves the project satisfies the feature. The mutation run probes whether tests are strong enough to fail when example data changes.
Rule Categories by Priority
| Priority |
Category |
Impact |
Prefix |
Rules |
| 1 |
Parser |
CRITICAL |
parser- |
9 |
| 2 |
JSON IR |
CRITICAL |
ir- |
4 |
| 3 |
Generator |
CRITICAL |
gen- |
2 |
| 4 |
Runtime |
HIGH |
rt- |
3 |
| 5 |
Step Handlers |
HIGH |
handler- |
4 |
| 6 |
Test Runner |
HIGH |
runner- |
2 |
| 7 |
Mutator Core |
HIGH |
mut- |
4 |
| 8 |
Value Mutation Rules |
HIGH |
val- |
10 |
| 9 |
Result Classification |
HIGH |
result- |
2 |
| 10 |
Conformance |
HIGH |
conform- |
1 |
| 11 |
Agent Setup |
HIGH |
setup- |
1 |
| 12 |
Mutation Execution |
MEDIUM |
exec- |
4 |
| 13 |
Reports |
MEDIUM |
report- |
3 |
| 14 |
Project Layout |
MEDIUM |
layout- |
3 |
Quick Reference
1. Parser (CRITICAL)
parser-command-interface - Two positional args, exit codes 0/1/2
parser-feature-declaration - Feature: keyword required, trimmed name
parser-background - Optional Background: section with Given/And steps
parser-scenarios - Scenario: and Scenario Outline: both supported
parser-steps - Given/When/Then/And keywords, keyword stored separately
parser-parameters - Angle-bracket placeholders, not expanded by parser
parser-examples-tables - Pipe-delimited tables, header row first
parser-general-rules - Blank lines, comments, whitespace, ordering
parser-unsupported-syntax - Tags, rules, localized keywords, doc strings
2. JSON IR (CRITICAL)
ir-feature-object - name, scenarios, optional background
ir-scenario-object - name, steps, examples arrays
ir-step-object - keyword, text, optional parameters
ir-example-object - String-keyed, string-valued maps
3. Generator (CRITICAL)
gen-command-interface - Two positional args, exit codes 0/1/2
gen-requirements - Embed IR, no Gherkin parsing, deterministic output
4. Runtime (HIGH)
rt-responsibilities - Load IR, expand, dispatch, report
rt-scenario-expansion - One execution per example row, background prepended
rt-execution-naming - Scenario name / example index naming convention
5. Step Handlers (HIGH)
handler-matching - Match by exact text value, not keyword
handler-world-state - Fresh world/state per scenario execution
handler-value-handling - Fetch, parse, fail on missing/malformed
handler-unsupported - Unsupported step text must fail the test
6. Test Runner (HIGH)
runner-interface - Input/output contract for the test runner adapter
runner-classification - Three-way: failure, success, infrastructure error
7. Mutator Core (HIGH)
mut-command-interface - CLI options, exit codes 0/1/2
mut-scope - Only example cell values mutated
mut-identity - Stable deterministic IDs, paths, descriptions
mut-deep-copy - Original IR never modified in place
8. Value Mutation Rules (HIGH)
val-rule-order - 8 rules applied in priority order
val-comma-list - Comma-delimited list mutation
val-boolean - true/false toggle
val-null - null/nil/none to dithered string
val-integer - Integer plus pseudo-random delta
val-float - Float plus pseudo-random delta
val-datetime - ISO-8601 date/time shift
val-duration - Duration shift preserving syntax
val-string-dither - Character-level string edits
val-determinism - Pseudo-random, deterministic for fixed input
9. Result Classification (HIGH)
result-statuses - killed, survived, error
result-classification-rules - Mapping from test outcomes to statuses
10. Conformance (HIGH)
conform-checklist - All 21 validation items
11. Agent Setup (HIGH)
setup-checklist - 15-step installation guide
12. Mutation Execution (MEDIUM)
exec-work-directory - Per-mutation directory structure
exec-workflow - Write IR, generate, run, classify
exec-parallelism - Concurrent workers, isolated directories
exec-timeout - Full-run timeout, unfinished = error
13. Reports (MEDIUM)
report-text-format - Summary line + per-result lines
report-json-format - JSON object with summary and results array
report-field-requirements - Required fields for summary and results
14. Project Layout (MEDIUM)
layout-required-paths - features/, build/, acceptance/ directories
layout-commands - gherkin-parser, acceptance-generator, gherkin-mutator
layout-scripts - Normal acceptance and mutation scripts
How to Use
Read individual reference files for detailed spec requirements and rationale:
- Start with the category relevant to the component you are building
- Each rule file is self-contained with WHY explanations, spec requirements, and examples
- For a new project setup, read
setup-checklist first
- For validation, use
conform-checklist
- Check gotchas.md for known failure points
Reference Files
| File |
Description |
| metadata.json |
Version and reference information |
| gotchas.md |
Known failure points (append-only) |
| references/ |
All rule files organized by prefix |
1---2name: acceptance-pipeline-catalog3description: Use when implementing, reviewing, or debugging a Gherkin acceptance-test pipeline with mutation testing. Covers parser, JSON IR, generator, runtime, step handlers, test runner, mutator, value mutation rules, execution, result classification, reporting, project layout, conformance, and agent setup. Based on Uncle Bob's Acceptance Pipeline Specification. Trigger even when the user mentions Gherkin parsing, acceptance test generation, mutation testing for acceptance tests, or building a portable test pipeline.4---5
6# Robert C. Martin Acceptance Pipeline Best Practices
7
8Language-neutral specification for a portable acceptance-test pipeline: Gherkin feature files to JSON IR to generated acceptance tests to mutation testing. Based on Robert C. Martin's Acceptance Pipeline Specification. Contains ~50 rules across 14 categories, prioritized by impact.
9
10## When to Apply
11
12Reference these rules when:
13- Building a Gherkin parser that outputs JSON IR
14- Implementing an acceptance test generator from JSON IR
15- Writing an acceptance runtime that expands scenarios and dispatches steps
16- Implementing mutation testing for acceptance test example values
17- Setting up the full pipeline (parser, generator, runner, mutator) in a new project
18- Debugging pipeline failures (parse errors, generation issues, mutation classification)
19
20## Pipeline Overview
21
22The pipeline has two modes:
23
24**Normal acceptance run:**
25```
26feature file -> gherkin parser -> JSON IR -> acceptance generator -> generated tests -> test runner
27```
28
29**Mutation run:**
30```
31feature file -> gherkin parser -> base JSON IR -> mutator (one changed IR per mutation)
32 -> generator (tests per mutation) -> test runner (evaluate each) -> mutation report
33```
34
35The normal run proves the project satisfies the feature. The mutation run probes whether tests are strong enough to fail when example data changes.
36
37## Rule Categories by Priority
38
39| Priority | Category | Impact | Prefix | Rules |
40|----------|----------|--------|--------|-------|
41| 1 | Parser | CRITICAL | `parser-` | 9 |
42| 2 | JSON IR | CRITICAL | `ir-` | 4 |
43| 3 | Generator | CRITICAL | `gen-` | 2 |
44| 4 | Runtime | HIGH | `rt-` | 3 |
45| 5 | Step Handlers | HIGH | `handler-` | 4 |
46| 6 | Test Runner | HIGH | `runner-` | 2 |
47| 7 | Mutator Core | HIGH | `mut-` | 4 |
48| 8 | Value Mutation Rules | HIGH | `val-` | 10 |
49| 9 | Result Classification | HIGH | `result-` | 2 |
50| 10 | Conformance | HIGH | `conform-` | 1 |
51| 11 | Agent Setup | HIGH | `setup-` | 1 |
52| 12 | Mutation Execution | MEDIUM | `exec-` | 4 |
53| 13 | Reports | MEDIUM | `report-` | 3 |
54| 14 | Project Layout | MEDIUM | `layout-` | 3 |
55
56## Quick Reference
57
58### 1. Parser (CRITICAL)
59
60- [`parser-command-interface`](references/parser-command-interface.md) - Two positional args, exit codes 0/1/2
61- [`parser-feature-declaration`](references/parser-feature-declaration.md) - Feature: keyword required, trimmed name
62- [`parser-background`](references/parser-background.md) - Optional Background: section with Given/And steps
63- [`parser-scenarios`](references/parser-scenarios.md) - Scenario: and Scenario Outline: both supported
64- [`parser-steps`](references/parser-steps.md) - Given/When/Then/And keywords, keyword stored separately
65- [`parser-parameters`](references/parser-parameters.md) - Angle-bracket placeholders, not expanded by parser
66- [`parser-examples-tables`](references/parser-examples-tables.md) - Pipe-delimited tables, header row first
67- [`parser-general-rules`](references/parser-general-rules.md) - Blank lines, comments, whitespace, ordering
68- [`parser-unsupported-syntax`](references/parser-unsupported-syntax.md) - Tags, rules, localized keywords, doc strings
69
70### 2. JSON IR (CRITICAL)
71
72- [`ir-feature-object`](references/ir-feature-object.md) - name, scenarios, optional background
73- [`ir-scenario-object`](references/ir-scenario-object.md) - name, steps, examples arrays
74- [`ir-step-object`](references/ir-step-object.md) - keyword, text, optional parameters
75- [`ir-example-object`](references/ir-example-object.md) - String-keyed, string-valued maps
76
77### 3. Generator (CRITICAL)
78
79- [`gen-command-interface`](references/gen-command-interface.md) - Two positional args, exit codes 0/1/2
80- [`gen-requirements`](references/gen-requirements.md) - Embed IR, no Gherkin parsing, deterministic output
81
82### 4. Runtime (HIGH)
83
84- [`rt-responsibilities`](references/rt-responsibilities.md) - Load IR, expand, dispatch, report
85- [`rt-scenario-expansion`](references/rt-scenario-expansion.md) - One execution per example row, background prepended
86- [`rt-execution-naming`](references/rt-execution-naming.md) - Scenario name / example index naming convention
87
88### 5. Step Handlers (HIGH)
89
90- [`handler-matching`](references/handler-matching.md) - Match by exact text value, not keyword
91- [`handler-world-state`](references/handler-world-state.md) - Fresh world/state per scenario execution
92- [`handler-value-handling`](references/handler-value-handling.md) - Fetch, parse, fail on missing/malformed
93- [`handler-unsupported`](references/handler-unsupported.md) - Unsupported step text must fail the test
94
95### 6. Test Runner (HIGH)
96
97- [`runner-interface`](references/runner-interface.md) - Input/output contract for the test runner adapter
98- [`runner-classification`](references/runner-classification.md) - Three-way: failure, success, infrastructure error
99
100### 7. Mutator Core (HIGH)
101
102- [`mut-command-interface`](references/mut-command-interface.md) - CLI options, exit codes 0/1/2
103- [`mut-scope`](references/mut-scope.md) - Only example cell values mutated
104- [`mut-identity`](references/mut-identity.md) - Stable deterministic IDs, paths, descriptions
105- [`mut-deep-copy`](references/mut-deep-copy.md) - Original IR never modified in place
106
107### 8. Value Mutation Rules (HIGH)
108
109- [`val-rule-order`](references/val-rule-order.md) - 8 rules applied in priority order
110- [`val-comma-list`](references/val-comma-list.md) - Comma-delimited list mutation
111- [`val-boolean`](references/val-boolean.md) - true/false toggle
112- [`val-null`](references/val-null.md) - null/nil/none to dithered string
113- [`val-integer`](references/val-integer.md) - Integer plus pseudo-random delta
114- [`val-float`](references/val-float.md) - Float plus pseudo-random delta
115- [`val-datetime`](references/val-datetime.md) - ISO-8601 date/time shift
116- [`val-duration`](references/val-duration.md) - Duration shift preserving syntax
117- [`val-string-dither`](references/val-string-dither.md) - Character-level string edits
118- [`val-determinism`](references/val-determinism.md) - Pseudo-random, deterministic for fixed input
119
120### 9. Result Classification (HIGH)
121
122- [`result-statuses`](references/result-statuses.md) - killed, survived, error
123- [`result-classification-rules`](references/result-classification-rules.md) - Mapping from test outcomes to statuses
124
125### 10. Conformance (HIGH)
126
127- [`conform-checklist`](references/conform-checklist.md) - All 21 validation items
128
129### 11. Agent Setup (HIGH)
130
131- [`setup-checklist`](references/setup-checklist.md) - 15-step installation guide
132
133### 12. Mutation Execution (MEDIUM)
134
135- [`exec-work-directory`](references/exec-work-directory.md) - Per-mutation directory structure
136- [`exec-workflow`](references/exec-workflow.md) - Write IR, generate, run, classify
137- [`exec-parallelism`](references/exec-parallelism.md) - Concurrent workers, isolated directories
138- [`exec-timeout`](references/exec-timeout.md) - Full-run timeout, unfinished = error
139
140### 13. Reports (MEDIUM)
141
142- [`report-text-format`](references/report-text-format.md) - Summary line + per-result lines
143- [`report-json-format`](references/report-json-format.md) - JSON object with summary and results array
144- [`report-field-requirements`](references/report-field-requirements.md) - Required fields for summary and results
145
146### 14. Project Layout (MEDIUM)
147
148- [`layout-required-paths`](references/layout-required-paths.md) - features/, build/, acceptance/ directories
149- [`layout-commands`](references/layout-commands.md) - gherkin-parser, acceptance-generator, gherkin-mutator
150- [`layout-scripts`](references/layout-scripts.md) - Normal acceptance and mutation scripts
151
152## How to Use
153
154Read individual reference files for detailed spec requirements and rationale:
155
156- Start with the category relevant to the component you are building
157- Each rule file is self-contained with WHY explanations, spec requirements, and examples
158- For a new project setup, read [`setup-checklist`](references/setup-checklist.md) first
159- For validation, use [`conform-checklist`](references/conform-checklist.md)
160- Check [gotchas.md](gotchas.md) for known failure points
161
162## Reference Files
163
164| File | Description |
165|------|-------------|
166| [metadata.json](metadata.json) | Version and reference information |
167| [gotchas.md](gotchas.md) | Known failure points (append-only) |
168| [references/](references/) | All rule files organized by prefix |