Skip to content

ADR-002: ADR 002 Gherkin Only Testing

Purpose: Architecture decision record for ADR 002 Gherkin Only Testing


PropertyValue
Statusaccepted
Categorytesting

Context: A package that generates documentation from .feature files had dual test approaches: 97 legacy .test.ts files alongside Gherkin features. This undermined the core thesis that Gherkin IS sufficient for all testing.

Decision: Enforce strict Gherkin-only testing for the delivery-process package:

  • All tests must be .feature files with step definitions
  • No new .test.ts files
  • Edge cases use Scenario Outline with Examples tables

Consequences:

TypeImpact
PositiveSingle source of truth for tests AND documentation
PositiveDemonstrates Gherkin sufficiency — the package practices what it preaches
PositiveLiving documentation always matches test coverage
PositiveForces better scenario design with Examples tables
NegativeScenario Outline syntax more verbose than parameterized tests

Invariant: Feature files serve as both executable specs and documentation source. This dual purpose is the primary benefit of Gherkin-only testing for this package.

Rationale: Parallel .test.ts files create a hidden test layer invisible to the documentation pipeline, undermining the single source of truth principle this package enforces.

ArtifactWithout Gherkin-OnlyWith Gherkin-Only
Tests.test.ts (hidden from docs).feature (visible in docs)
Business rulesManually maintainedExtracted from Rule blocks
Acceptance criteriaImplicit in test codeExplicit @acceptance-criteria tags
TraceabilityManual cross-referencing@libar-docs-implements links

← Back to All Decisions