v1bh0r/precise-ledger-pro/nw-bdd-methodology
Claude Code and agent skill by v1bh0r/precise-ledger-pro
- community
Checking that the SKILL.md file is still in the repository.
BDD patterns for acceptance test design - Given-When-Then structure, scenario writing rules, pytest-bdd implementation, anti-patterns, and living documentation
Install
npx vskill@latest install v1bh0r/precise-ledger-pro/nw-bdd-methodologySKILL.md
The same SKILL.md was published earlier as nwave-ai/nwave/nw-bdd-methodology.
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 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.
Scenario Categorization
- Happy path: Primary successful workflows
- Error path: Invalid inputs, failures, unauthorized access (target 40%+ of scenarios)
- Edge case: Boundary conditions, unusual but valid behavior
- Integration: Cross-component/system interactions
Golden Path + Key Alternatives
Per capability: 1. Happy path (most common success) | 2. Alternative paths (valid but less common) | 3. Error paths (invalid inputs, constraint violations). Select representative examples revealing different business rules. Do not test every combination.
Scenario Outlines for Boundary Testing
Use outlines for boundary conditions and calculation variations. Avoid when scenarios diverge structurally.
pytest-bdd Implementation
Step Definitions with Fixture Injection
Step Organization by Domain
Organize by domain concept, not feature file:
Fixture Scopes for Performance
Session: expensive setup (DB engine, app instance) | Module: schema creation | Function: data cleanup (autouse=True)
Production-Like Test Environment
Use real services (database, message queue) with test data. Avoid mocks at acceptance level.
Anti-Patterns
| Anti-Pattern | Fix | |
|---|---|---|
| Testing through UI | Test through service/API layer | |
| Multiple WHEN actions | Split into separate scenarios | |
| Feature-coupled steps | Organize by domain concept | |
| Conjunction steps ("Given A and B" as one step) | Break into atomic steps | |
| Incidental details | Include only behavior-relevant info | |
| Technical jargon in scenarios | Business domain language | |
| Abstract scenarios | Concrete values, specific examples | |
| Rambling scenarios (8+ steps) | Extract to 3-5 focused steps |
Living Documentation
Scenarios serve dual purpose: executable tests and living documentation. Organization: Business Goal > Capability > Feature > Scenario > Test. Each scenario traces to business capability. Stakeholders see which capabilities are implemented, tested, passing.
Documentation-Grade Scenarios
Replace HTTP verbs with business actions, JSON with domain concepts, status codes with business outcomes. Add context about WHO and WHY.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingnWave/skills/nw-bdd-methodology/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/v1bh0r/precise-ledger-pro/nw-bdd-methodology)