# Nw Bdd Methodology

BDD patterns for acceptance test design - Given-When-Then structure, scenario writing...

- Repository: https://github.com/nWave-ai/nWave (628 stars)
- Category: Design
- License: MIT
- Last updated: 2026-09-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add nWave-ai/nWave --skill nw-bdd-methodology -g -a claude-code -y`
Codex: `npx skills add nWave-ai/nWave --skill nw-bdd-methodology -g -a codex -y`
Cursor: `npx skills add nWave-ai/nWave --skill nw-bdd-methodology -g -a cursor -y`
Gemini CLI: `npx skills add nWave-ai/nWave --skill nw-bdd-methodology -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add nWave-ai/nWave`

## Description

BDD patterns for acceptance test design - Given-When-Then structure, scenario writing rules, pytest-bdd implementation, anti-patterns, and living documentation

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:
1. Write failing acceptance test from user perspective (outer loop -- outside)
2. Software-crafter drops to inner loop: unit tests to implement components (inside)
3. Iterate inner loop until acceptance test passes
4. Passing acceptance test proves user value delivered
5. Repeat for next behavior

Outer loop defines WHAT users need (outside). Inner loop drives HOW to build it (inside).

## Given-When-Then Structure

```gherkin
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.

The rest: https://github.com/nWave-ai/nWave/blob/HEAD/nWave/skills/nw-bdd-methodology/SKILL.md
