Nw Bdd Methodology
BDD patterns for acceptance test design - Given-When-Then structure, scenario writing...
Install
npx skills add nWave-ai/nWave --skill nw-bdd-methodology -g -a claude-code -y- Repository
- nWave-ai/nWave628
- Category
- Design
- Updated
- 2mo ago
- License
- MIT
- Context cost
- Lightabout 1,458 tokens
- Runs scripts
- No, instructions only
What it does
BDD patterns for acceptance test design - Given-When-Then structure, scenario writing rules, pytest-bdd implementation, anti-patterns, and living documentation
BDD Methodology for Acceptance Test Design
Core Philosophy
Test units of behavior, not units of code. Acceptance tests validate business outcomes through public interfaces, decoupled from implementation.
Outside-In Double-Loop TDD
The acceptance-designer creates the outer loop of Outside-In TDD. Development starts from user perspective, drives inward.
Outer loop (acceptance/BDD): Hours to days | User perspective, business language | Defines "done" | Scenarios describe user goals and observable outcomes, not internals | Failing outer-loop test is the starting signal for implementation
Inner loop (unit/TDD): Minutes | Developer perspective, technical terms | Software-crafter owns this loop
Workflow:
- Write failing acceptance test from user perspective (outer loop -- outside)
- Software-crafter drops to inner loop: unit tests to implement components (inside)
- Iterate inner loop until acceptance test passes
- Passing acceptance test proves user value delivered
- Repeat for next behavior
Outer loop defines WHAT users need (outside). Inner loop drives HOW to build it (inside).
Given-When-Then Structure
Scenario: [Business-focused title describing one behavior]
Given [preconditions - system state in business terms]
When [single user action or business event]
Then [observable business outcome]
Scenario Writing Rules
Rule 1: One scenario, one behavior -- Split multi-behavior scenarios.
Rule 2: Declarative, not imperative -- Business outcomes, not UI interactions. "When I log in with valid credentials" not "When I click Login button and enter email."
Rule 3: Concrete examples, not abstractions -- "Given my account balance is $100.00" not "Given the user has sufficient funds."
Rule 4: Keep scenarios short (3-5 steps) -- Longer means testing multiple behaviors or irrelevant details.
Rule 5: Background for shared Given steps only -- Only Given steps. Actions/validations in scenarios.


