SDD Test Planner Skill
Principio: Un plan de testing no es una lista de tests — es una estrategia que garantiza que cada requisito,
cada invariante y cada contrato tiene verificación adecuada en el tipo, nivel y momento correcto.
SWEBOK v4 Ch04: "Testing is the dynamic verification that a program provides expected behaviors."
Purpose
Generate comprehensive test strategies, test matrices, performance scenarios, and E2E acceptance scenarios from specification documents. Bridge the gap between BDD scenarios (in spec/tests/) and actionable test tasks (in task/), including end-to-end user journey validation.
When to Use This Skill
- Specifications exist in
spec/ and have been audited by sdd-spec-auditor
- You need a test strategy before generating implementation plans
- You want to define test coverage targets per FASE
- You need performance test scenarios derived from NFRs
- You want to audit test completeness of existing BDD specs
- You want to generate test matrices for complex use cases
- You need E2E acceptance scenarios derived from workflows (WF-*)
When NOT to Use This Skill
- To write or execute tests → use
sdd-task-implementer
- To audit specs for quality → use
sdd-spec-auditor
- To generate task files → use
sdd-task-generator
- To create specs → use
sdd-specifications-engineer
Relationship to Other Skills
| Skill |
Relationship |
sdd-specifications-engineer |
Upstream: produces spec/tests/BDD-*.md and spec/nfr/*.md |
sdd-spec-auditor |
Upstream: validates spec quality before test planning |
sdd-security-auditor |
Lateral: security findings feed into security test scenarios |
sdd-ux-designer |
Lateral (optional): enriches E2E scenarios with page objects and a11y assertions |
sdd-test-planner |
THIS SKILL: produces test strategy, matrices, and E2E scenarios |
sdd-plan-architect |
Downstream: consumes test strategy for FASE planning |
sdd-task-generator |
Downstream: consumes test matrices to generate test tasks |
Pipeline Position
Requisitos → sdd-specifications-engineer → sdd-spec-auditor →
↓
sdd-test-planner ← YOU ARE HERE
↓
sdd-plan-architect
↓
sdd-task-generator
↓
sdd-task-implementer
Lateral: sdd-security-auditor → feeds security test scenarios
Lateral: sdd-ux-designer → enriches E2E scenarios (optional)
SWEBOK v4 alignment:
- Ch04 §1: Testing Fundamentals (levels, types, techniques)
- Ch04 §2: Test Process (planning, design, execution, evaluation)
- Ch04 §3: Test Techniques (black-box, white-box, experience-based)
- Ch04 §4: Test Measurement (coverage, defect metrics)
- Ch04 §5: Test Management (planning, estimation, monitoring)
Modes of Operation
Mode 1: Generate Test Strategy
Use when the user wants a comprehensive test plan for the project.
Readiness Gates:
- G1:
spec/ directory exists with at least domain/, use-cases/, contracts/
- G2:
spec/tests/BDD-*.md files exist (at least partially)
- G3:
spec/nfr/*.md files exist (at least PERFORMANCE.md)
Process:
Read all specification documents:
spec/use-cases/UC-*.md → extract main flows, exception flows, actors
spec/tests/BDD-*.md → extract existing BDD scenarios
spec/nfr/PERFORMANCE.md → extract performance targets
spec/nfr/SECURITY.md → extract security requirements
spec/nfr/LIMITS.md → extract rate limits and thresholds
spec/domain/05-INVARIANTS.md → extract all invariants
spec/contracts/API-*.md → extract endpoint contracts
spec/contracts/EVENTS-*.md → extract event schemas
audits/SECURITY-AUDIT-BASELINE.md → extract security findings (if exists)
Classify test types needed per spec element:
| Spec Element |
Test Types |
Level |
| Entity invariants (INV-*) |
Unit tests (property-based) |
Unit |
| UC main flows |
BDD scenarios (Given/When/Then) |
Integration |
| UC exception flows |
Negative BDD scenarios |
Integration |
| API contracts |
Contract tests (request/response schema) |
Integration |
| Event schemas |
Event contract tests (schema validation) |
Integration |
| Workflows (WF-*) |
End-to-end scenarios |
E2E |
| NFR Performance |
Load tests, stress tests |
Performance |
| NFR Security |
Penetration tests, auth bypass tests |
Security |
| NFR Limits |
Rate limit tests, quota enforcement |
Integration |
| Cross-UC flows |
Saga/choreography tests |
E2E |
Identify gaps in existing BDD specs:
- UCs without BDD file → flag as
MISSING-BDD
- UCs with BDD but missing exception flows → flag as
INCOMPLETE-BDD
- Invariants without property tests → flag as
MISSING-PROPERTY-TEST
- NFRs without measurable test scenarios → flag as
MISSING-NFR-TEST
- WFs without E2E scenarios → flag as
MISSING-E2E (addressed by Mode 5)
Define coverage targets per FASE:
- Ask user for overall coverage target (recommend 80% minimum)
- Map test types to FASEs using
plan/fases/FASE-*.md (if exists)
- If plan doesn't exist yet, group by bounded context
Generate test/TEST-PLAN.md:
# Test Plan
> **Project:** {project name}
> **Version:** {X.Y}
> **Generated from:** spec/ (audit-clean)
> **SWEBOK alignment:** Ch04 — Software Testing
## Test Strategy Summary
| Metric | Target | Current |
|--------|--------|---------|
| BDD scenario coverage (UCs) | 100% of main + exception flows | {N}% |
| Invariant test coverage | 100% of INV-* | {N}% |
| Contract test coverage | 100% of API endpoints | {N}% |
| NFR test coverage | 100% of measurable NFRs | {N}% |
| Security test coverage | 100% of OWASP Top 10 applicable | {N}% |
| E2E workflow coverage | 100% of user-facing WF-* | {N}% |
## Test Levels
### Unit Tests
- **Scope:** Entity invariants, value object validation, pure business logic
- **Technique:** Property-based testing for invariants, example-based for logic
- **Framework:** {recommend based on tech stack or ask user}
- **Coverage target:** {N}% line coverage on domain layer
### Integration Tests
- **Scope:** UC flows via API endpoints, event handling, database operations
- **Technique:** BDD scenarios (Given/When/Then), contract testing
- **Data:** Test fixtures derived from spec entity schemas
- **Coverage target:** 100% of UC main flows, {N}% of exception flows
### End-to-End Tests
- **Scope:** Multi-UC workflows, cross-service user journeys
- **Technique:** Scenario-based testing following WF-* specs (see `test/E2E-SCENARIOS.md` if Mode 5 was run)
- **Framework:** Playwright recommended (browser), APIRequestContext (API-only), subprocess (CLI)
- **Environment:** Staging environment with test data, isolated browser contexts
- **Data strategy:** {transaction-rollback | snapshot-restore | unique-per-test}
- **Accessibility:** axe-core scan at each navigation step (WCAG 2.1 AA)
- **Coverage target:** 100% of user-facing WF-* workflows
- **Tiered execution:**
- Smoke (P0 happy paths): every PR, < 2 min
- Critical (P0+P1): every merge to main, < 10 min
- Full E2E suite: nightly / release, < 30 min
### Performance Tests
- **Scope:** Response time (p99), throughput, concurrent users
- **Technique:** Load testing, stress testing, soak testing
- **Targets:** From spec/nfr/PERFORMANCE.md
- **Schedule:** Run on every FASE completion
### Security Tests
- **Scope:** Authentication bypass, authorization escalation, injection, data exposure
- **Technique:** OWASP ASVS v4 checklist + automated scanning
- **Targets:** From spec/nfr/SECURITY.md + security audit findings
## Test Gaps Identified
| Gap ID | Type | Spec Element | Missing Test | Priority |
|--------|------|-------------|--------------|----------|
| GAP-001 | MISSING-BDD | UC-{NNN} | No BDD file exists | High |
| GAP-002 | INCOMPLETE-BDD | UC-{NNN} | Exception flow {N} not covered | Medium |
| GAP-003 | MISSING-PROPERTY-TEST | INV-{PREFIX}-{NNN} | No property test defined | Medium |
| GAP-004 | MISSING-NFR-TEST | PERFORMANCE p99 target | No load test scenario | High |
| GAP-005 | MISSING-E2E | WF-{NNN} | No E2E scenario for user-facing workflow | High |
## Per-FASE Test Targets
| FASE | Unit Tests | Integration Tests | E2E Tests | Perf Tests |
|------|-----------|-------------------|-----------|------------|
| FASE-0 | INV-SYS-* | Auth flows | Health check | Baseline |
| FASE-1 | INV-{PREFIX}-* | UC-{NNN} flows | WF-{NNN} | Load targets |
| ... | ... | ... | ... | ... |
## Regression Strategy
- **On every commit:** Unit tests + affected integration tests
- **On FASE completion:** Full integration + E2E suite
- **On release candidate:** Full suite + performance + security
Mode 2: Generate Test Matrices
Use when the user wants detailed input/output matrices for complex use cases.
Process:
Read target UC spec (spec/use-cases/UC-NNN-*.md)
Extract inputs: All parameters, preconditions, actor roles
Apply test design techniques (SWEBOK v4 Ch04 §3):
a. Equivalence Partitioning:
- For each input, identify valid and invalid partitions
- Select one representative value per partition
b. Boundary Value Analysis:
- For each numeric/range input, identify boundary values
- Include: min-1, min, min+1, max-1, max, max+1
c. Decision Table:
- For UCs with multiple conditions, build condition/action table
- Each row = one test case
d. State Transition:
- For entities with state machines (
spec/domain/04-STATES.md)
- Generate tests for each valid transition AND each invalid transition
Generate test/TEST-MATRIX-UC-{NNN}.md:
# Test Matrix: UC-{NNN} — {title}
## Inputs
| Input | Type | Valid Partitions | Invalid Partitions | Boundaries |
|-------|------|------------------|--------------------|------------|
| {param} | {type} | {valid ranges} | {invalid values} | {boundary values} |
## Decision Table
| # | Cond1 | Cond2 | Cond3 | Expected Action | Expected Status |
|---|-------|-------|-------|-----------------|-----------------|
| T1 | true | true | true | {action} | {status} |
| T2 | true | true | false | {action} | {status} |
| ... | | | | | |
## State Transition Tests (if applicable)
| Current State | Event | Expected Next State | Postconditions |
|---------------|-------|---------------------|----------------|
| {state} | {event} | {next_state} | {postconditions} |
| {state} | {invalid_event} | {same_state} | Error: {message} |
## Traceability
| Test Case | Covers | Spec Ref |
|-----------|--------|----------|
| T1 | Main flow step 3 | UC-{NNN} §main.3 |
| T2 | Exception flow 1 | UC-{NNN} §exception.1 |
Mode 3: Generate Performance Scenarios
Use when the user needs performance test scenarios derived from NFR specs.
Process:
Read NFR documents:
spec/nfr/PERFORMANCE.md → response time targets, throughput
spec/nfr/LIMITS.md → rate limits, quotas, thresholds
spec/contracts/API-*.md → endpoint patterns and expected load
Generate scenarios per NFR target:
| Scenario Type |
Purpose |
Duration |
| Smoke |
Verify baseline functionality under minimal load |
1 min |
| Load |
Verify p99 targets under expected concurrent users |
10 min |
| Stress |
Find breaking point beyond expected load |
15 min |
| Soak |
Detect memory leaks under sustained load |
1 hour |
| Spike |
Verify recovery from sudden traffic bursts |
5 min |
Generate test/PERF-SCENARIOS.md:
# Performance Test Scenarios
> Derived from: spec/nfr/PERFORMANCE.md, spec/nfr/LIMITS.md
## Targets (from specs)
| Metric | Target | Source |
|--------|--------|--------|
| API response time (p99) | < {N}ms | PERFORMANCE.md |
| Throughput | {N} req/s | PERFORMANCE.md |
| Concurrent users | {N} | PERFORMANCE.md |
| Rate limit (per user) | {N} req/min | LIMITS.md |
## Scenarios
### PERF-001: API Load Test
- **Type:** Load
- **Target endpoint:** {most critical endpoint from contracts}
- **Concurrent users:** {from NFR}
- **Duration:** 10 minutes
- **Success criteria:** p99 < {target}ms, 0% error rate
- **Ramp-up:** Linear over 2 minutes
### PERF-002: Rate Limit Enforcement
- **Type:** Stress
- **Target:** Rate limit threshold
- **Method:** Single user exceeding {N} req/min
- **Success criteria:** 429 returned after limit, Retry-After header present
### PERF-003: Database Query Performance
- **Type:** Load
- **Target:** Queries with complex joins or full-text search
- **Dataset:** {N} records (10x expected production size)
- **Success criteria:** p99 < {target}ms
Mode 4: Audit Test Coverage
Use when the user wants to verify that existing test specs are complete.
Process:
Build traceability matrix:
- List ALL UCs, invariants, contracts, workflows, NFRs
- For each, check if a corresponding test exists in
spec/tests/
Compute coverage metrics:
| Dimension |
Formula |
Target |
| UC Coverage |
UCs with BDD / total UCs |
100% |
| Exception Coverage |
Exception flows tested / total exception flows |
≥ 80% |
| Invariant Coverage |
INVs with property tests / total INVs |
100% |
| Contract Coverage |
Endpoints with contract tests / total endpoints |
100% |
| NFR Coverage |
Measurable NFRs with test scenarios / total measurable NFRs |
100% |
| E2E Coverage |
User-facing WFs with E2E scenarios / total user-facing WFs |
100% |
Output coverage report with gaps and recommendations
Mode 5: Generate E2E Acceptance Scenarios
Use when the user needs end-to-end acceptance test scenarios that validate complete user journeys through the system. Produces actionable scenarios traceable from workflows back to requirements.
Readiness Gates:
- G1:
spec/workflows/WF-*.md files exist (at least one)
- G2:
spec/use-cases/UC-*.md files exist
- G3:
spec/tests/BDD-*.md files exist (at least partially)
Process:
Detect project type:
IF ux/ directory exists AND ux/WIREFRAMES.md is present:
→ project_type = WEB-APP (full browser E2E with page objects)
ELIF spec/contracts/API-*.md exists AND no ux/:
→ project_type = API-ONLY (API E2E via HTTP, no browser)
ELIF project is CLI tool (detected from plan/ARCHITECTURE.md or CLAUDE.md):
→ project_type = CLI (subprocess E2E)
ELSE:
→ project_type = LIBRARY (skip E2E, document exemption)
If project_type = LIBRARY, output a note in TEST-PLAN.md explaining E2E exemption and stop.
Read workflow and spec artifacts:
spec/workflows/WF-*.md → extract user journeys, steps, actors, cross-UC flows
spec/use-cases/UC-*.md → extract main flows, exception flows, ALL input parameters with types and required/optional
spec/tests/BDD-*.md → extract existing acceptance criteria (reuse, don't duplicate)
spec/contracts/API-*.md → extract endpoints involved in each workflow, including ALL request body fields with required/optional and validation rules
requirements/REQUIREMENTS.md → build transitive REQ→UC→WF mapping for traceability
Read UX artifacts (if project_type = WEB-APP and ux/ exists):
ux/WIREFRAMES.md → extract component inventory, interactive elements per screen
ux/INTERACTION-MODEL.md → extract state diagrams, loading states, error states, conditional visibility rules
ux/ACCESSIBILITY-SPEC.md → extract keyboard navigation matrix, ARIA mappings
Build field inventory per workflow (MANDATORY):
For each WF-* that will have E2E scenarios, enumerate ALL fields from three sources and cross-reference them:
WF-007 Field Inventory (from UC-003, API-SRV-01, WIREFRAMES §WF-007):
| Field | UC param | API field | Wireframe element | Required | Type | Validation rules | Conditional? |
|--------------|----------|-----------|----------------------------|----------|-----------|--------------------------|--------------|
| clienteId | UC-003.1 | body.clienteId | Cliente [v Buscar...] | Yes | select | Must exist in system | No |
| tipoServicio | UC-003.2 | body.tipo | (o) Fibra ( ) Movil | Yes | radio | enum: fibra, movil | No |
| velocidad | UC-003.3 | body.velocidad | Velocidad [v 300Mb...] | Yes | select | depends on tipoServicio | Yes: only when tipoServicio=fibra |
| ... | ... | ... | ... | ... | ... | ... | ... |
Cross-validation rules (STOP on ERROR, warn on WARN):
V-FIELD-01 (ERROR): Every required field in the API contract MUST appear in the inventory with a UC param source
V-FIELD-02 (ERROR): Every UC input parameter MUST appear in the inventory
V-FIELD-03 (ERROR): Every interactive input element in the wireframe MUST appear in the inventory (buttons excluded — only data-entry elements)
V-FIELD-04 (WARN): A field in UC/API but not in the wireframe → flag as MISSING-UI for user review
V-FIELD-05 (WARN): A wireframe element not in UC/API → flag as UI-ONLY, may need interaction step
If any ERROR is found, present the table to the user and STOP. This is a spec inconsistency that must be resolved before generating scenarios.
Build field behavioral matrix (MANDATORY):
For each field in the inventory, define the behavioral scenarios it requires:
WF-007 Field Behavioral Matrix:
| Field | VALID | EMPTY | INVALID | BOUNDARY | CONDITIONAL |
|--------------|--------------------|--------------------|-----------------------|--------------------|--------------------------------------|
| clienteId | Select existing | Submit without → | Non-existent ID → | — | — |
| | client → proceed | blocked/error msg | error msg | | |
| tipoServicio | Select fibra → | Submit without → | — | — | fibra → show velocidad, plan fields |
| | show fibra fields | blocked/error msg | | | movil → show linea, portab fields |
| velocidad | Select 300Mb → | Submit without → | — | — | Only visible when tipoServicio=fibra |
| | proceed | blocked/error msg | | | Hidden when tipoServicio=movil |
Behavioral categories:
- VALID: Standard happy-path value → expected positive behavior
- EMPTY: Required field left blank → expected validation error or submit block
- INVALID: Wrong type, format, or value → expected validation error message
- BOUNDARY: Edge values (min/max length, min/max numeric) → reuse from TEST-MATRIX if exists
- CONDITIONAL: Field visibility/value changes triggered by other fields → test that field appears/disappears/resets correctly
Rules:
- Every required field MUST have at least VALID + EMPTY behaviors defined
- Every field with validation rules MUST have at least one INVALID behavior
- Every field marked
Conditional? = Yes MUST have CONDITIONAL behaviors for each trigger value
- Fields with interactions (e.g., selecting client loads client data) MUST document the interaction chain
Generate E2E scenarios from field behavioral matrix:
For each WF-* that involves user interaction, generate scenarios driven by the field behavioral matrix, not by narrative walkthrough:
a. Happy path scenario (P0):
- One step per field in the inventory (ALL of them), filled with VALID values in the order they appear in the wireframe
- Final submit and assert postcondition
- Every MAPPED field MUST have a Fill/Select/Click step. If a field is missing from the steps, the scenario is incomplete.
b. Required-field validation scenarios (P0):
- For each required field: leave it empty, fill all others with valid values, attempt submit
- Assert: specific validation error message for that field (from UC exception flows or API 400 response)
- Combine into a variation table when possible (one row per required field)
c. Invalid-value scenarios (P1):
- For each field with INVALID behaviors in the matrix: fill with invalid value, fill all others with valid values, attempt submit
- Assert: specific validation error for that field
- Combine into a variation table
d. Conditional behavior scenarios (P1):
- For each CONDITIONAL field: test that changing the trigger field correctly shows/hides/resets dependent fields
- Example: select tipoServicio=fibra → assert velocidad field appears; switch to movil → assert velocidad disappears and linea field appears
- Include "field reset" behavior: if user fills conditional fields, then changes trigger → conditional fields should reset
e. Field interaction scenarios (P1):
- For each field interaction chain: test the full chain
- Example: select clienteId → client data loads → dependent fields auto-populate
f. UC exception flow scenarios (P1/P2):
- One row per exception flow in the constituent UCs (as before)
- These are ADDITIONAL to field-level scenarios — they cover business logic errors, not field validation
g. Accessibility gate:
- axe-core scan at each major navigation step
- Keyboard-only form completion (tab through all fields, submit with Enter)
Post-generation completeness check (MANDATORY):
After generating all scenarios, build and output this verification matrix:
WF-007 Field Coverage Verification:
| Field | Happy path step? | Empty variation? | Invalid variation? | Conditional tested? | Interaction tested? | Status |
|--------------|-----------------|------------------|-------------------|--------------------|--------------------|--------|
| clienteId | Step 3 ✅ | Var E2E-02 ✅ | Var E2E-05 ✅ | N/A | E2E-WF-007-05 ✅ | COMPLETE |
| tipoServicio | Step 4 ✅ | Var E2E-03 ✅ | N/A | E2E-WF-007-04 ✅ | N/A | COMPLETE |
| velocidad | Step 5 ✅ | Var E2E-04 ✅ | N/A | E2E-WF-007-04 ✅ | N/A | COMPLETE |
Completeness rules:
- Every required field MUST have: happy path step + empty variation → otherwise status =
INCOMPLETE
- Every field with validation rules MUST have: invalid variation → otherwise status =
INCOMPLETE
- Every conditional field MUST have: conditional scenario → otherwise status =
INCOMPLETE
- If ANY field has status
INCOMPLETE, flag as finding and ask user whether to add the missing scenario or document exemption with justification
Build transitive coverage matrix:
Map each E2E scenario back to the REQs it covers transitively:
E2E-WF-001-01 → WF-001 → {UC-003, UC-004} → {REQ-FUNC-010, REQ-FUNC-011}
For REQs not covered by any E2E scenario, classify as:
EXEMPT-BACKEND: Internal/infrastructure REQ, no user-facing flow
EXEMPT-NFR: Non-functional REQ, covered by performance/security tests
GAP: User-facing REQ with no transitive E2E coverage → flag for review
Generate test/E2E-SCENARIOS.md:
# E2E Acceptance Scenarios
> **Project:** {project name}
> **Project type:** {WEB-APP | API-ONLY | CLI}
> **Generated from:** spec/workflows/, spec/use-cases/, spec/contracts/
> **UX enrichment:** {Yes — from ux/ | No — abstract scenarios}
## E2E Strategy
| Dimension | Value |
|-----------|-------|
| Framework | Playwright (recommended) |
| Selector strategy | getByRole > getByLabel > getByText > getByTestId (fallback) |
| Auth strategy | storageState reuse (1 login test, others reuse state) |
| Data strategy | {transaction-rollback | snapshot-restore | unique-per-test} |
| Accessibility | axe-core scan at each navigation (WCAG 2.1 AA) |
| Parallelism | Playwright sharding across {N} workers |
### Tiered Execution
| Tier | Scenarios | Run time | Trigger |
|------|-----------|----------|---------|
| Smoke | P0 happy paths only | < 2 min | Every PR |
| Critical | P0 + P1 paths | < 10 min | Every merge to main |
| Full | All E2E scenarios | < 30 min | Nightly / release |
### Viewport Matrix (WEB-APP only, derived from ux/DESIGN-TOKENS.json)
| Viewport | Width | Run |
|----------|-------|-----|
| Mobile | 375px | P0 + P1 scenarios |
| Desktop | 1280px | All scenarios |
---
## Field Inventory: WF-{NNN}
> Cross-referenced from: UC-{NNN} params, API-{NNN} body, WIREFRAMES §{screen}
| Field | UC param | API field | Wireframe element | Required | Type | Validation rules | Conditional? |
|-------|----------|-----------|-------------------|----------|------|-----------------|--------------|
| {field1} | UC-{NNN}.1 | body.{f1} | {element desc} | Yes | {type} | {rules} | No |
| {field2} | UC-{NNN}.2 | body.{f2} | {element desc} | Yes | {type} | {rules} | Yes: when {trigger} |
| ... | ... | ... | ... | ... | ... | ... | ... |
### Field Behavioral Matrix: WF-{NNN}
| Field | VALID | EMPTY | INVALID | BOUNDARY | CONDITIONAL |
|-------|-------|-------|---------|----------|-------------|
| {field1} | {valid action → expected result} | {submit without → expected error} | {bad value → expected error} | {edge values if applicable} | {N/A or trigger→effect} |
| {field2} | {valid action → expected result} | {submit without → expected error} | {N/A or bad value → error} | {N/A or edge values} | {trigger changes → field shows/hides/resets} |
---
## Scenarios
### E2E-WF-{NNN}-01: {Workflow title} — Happy Path (P0)
- **Workflow:** WF-{NNN}
- **Use Cases:** UC-{NNN}, UC-{NNN}
- **Requirements (transitive):** REQ-FUNC-{NNN}, REQ-FUNC-{NNN}
- **Priority:** P0
- **Tier:** smoke
- **Auth fixture:** {authenticated | admin | unauthenticated}
- **Fields covered:** ALL ({N} fields from inventory)
#### Elements Referenced (when ux/ exists)
| Element | Locator hint | Source |
|---------|-------------|--------|
| {name} | getByRole("{role}", { name: /{pattern}/i }) | WIREFRAMES §{screen} |
| {name} | getByLabel("{label}") | WIREFRAMES §{screen} |
#### Steps
> One step per field in inventory, in wireframe presentation order. No field may be skipped.
| # | Action | Target | Assertion | Spec Ref |
|---|--------|--------|-----------|----------|
| 1 | Navigate to {url} | — | Page title = "{title}" | WF-{NNN} step 1 |
| 2 | axe-core scan | full page | No violations | ACCESSIBILITY-SPEC |
| 3 | Fill/Select {field1} | {element} | Field accepts input, {interaction effect if any} | UC-{NNN} §main.{N} |
| 4 | Fill/Select {field2} | {element} | Field accepts input, {conditional fields appear if applicable} | UC-{NNN} §main.{N} |
| ... | (one step per field from inventory) | ... | ... | ... |
| N | Click submit | {button} | {expected success feedback} | UC-{NNN} §main.{N} |
| N+1 | Assert final state | — | {postcondition} | WF-{NNN} postcondition |
### E2E-WF-{NNN} — Required-Field Validation (P0)
> One variation per required field. All other fields filled with valid values.
| Variant ID | Empty field | Other fields | Action | Expected behavior | Spec Ref |
|------------|-------------|-------------|--------|-------------------|----------|
| E2E-WF-{NNN}-V01 | {field1} | All valid | Submit | Error: "{validation message}" | UC-{NNN} §exception.{N} |
| E2E-WF-{NNN}-V02 | {field2} | All valid | Submit | Error: "{validation message}" | UC-{NNN} §exception.{N} |
### E2E-WF-{NNN} — Invalid-Value Scenarios (P1)
> One variation per field with validation rules. All other fields filled with valid values.
| Variant ID | Field | Invalid value | Other fields | Expected behavior | Spec Ref |
|------------|-------|---------------|-------------|-------------------|----------|
| E2E-WF-{NNN}-IV01 | {field} | {invalid value} | All valid | Error: "{validation message}" | UC-{NNN} §exception.{N} |
### E2E-WF-{NNN} — Conditional Behavior Scenarios (P1)
> One scenario per conditional field trigger. Tests visibility, reset, and dependent field behavior.
| Variant ID | Trigger field | Trigger value | Expected effect | Reset tested? | Spec Ref |
|------------|---------------|---------------|-----------------|---------------|----------|
| E2E-WF-{NNN}-CD01 | {trigger} | {value1} | {fields shown/hidden, values reset} | Yes | UC-{NNN} §main.{N}, INTERACTION-MODEL §{state} |
| E2E-WF-{NNN}-CD02 | {trigger} | {value2} | {different fields shown/hidden} | Yes | UC-{NNN} §main.{N} |
### E2E-WF-{NNN} — Field Interaction Scenarios (P1)
> Tests interaction chains where one field's value affects others (auto-populate, cascading selects, etc.)
| Variant ID | Source field | Action | Affected fields | Expected effect | Spec Ref |
|------------|-------------|--------|-----------------|-----------------|----------|
| E2E-WF-{NNN}-FI01 | {field} | {select value} | {field2, field3} | {auto-populated/filtered/enabled} | UC-{NNN} §main.{N} |
### E2E-WF-{NNN} — UC Exception Flows (P1/P2)
> Business logic errors beyond field validation (e.g., duplicate detection, insufficient permissions, external service failures).
| Variant ID | Diverges at step | Input change | Expected behavior | Spec Ref |
|------------|------------------|-------------|-------------------|----------|
| E2E-WF-{NNN}-EX01 | Step {N} | {precondition not met} | {error/redirect/fallback} | UC-{NNN} §exception.{N} |
### E2E-WF-{NNN} — Accessibility (P1)
> Keyboard-only and screen-reader scenarios.
| Variant ID | Scenario | Steps | Assertion | Spec Ref |
|------------|----------|-------|-----------|----------|
| E2E-WF-{NNN}-A11Y-01 | Keyboard-only completion | Tab through all {N} fields, fill each, Enter to submit | All fields reachable, submit succeeds | ACCESSIBILITY-SPEC |
---
## Field Coverage Verification
> Post-generation completeness check. Every field MUST have COMPLETE status.
### WF-{NNN}
| Field | Happy path step? | Empty variation? | Invalid variation? | Conditional tested? | Interaction tested? | Status |
|-------|-----------------|------------------|-------------------|--------------------|--------------------|--------|
| {field1} | Step {N} ✅ | V01 ✅ | IV01 ✅ | N/A | FI01 ✅ | COMPLETE |
| {field2} | Step {N} ✅ | V02 ✅ | N/A | CD01 ✅ | N/A | COMPLETE |
**Completeness rules:**
- Required field without empty variation → `INCOMPLETE`
- Field with validation rules without invalid variation → `INCOMPLETE`
- Conditional field without conditional scenario → `INCOMPLETE`
- Any `INCOMPLETE` → flag as finding, ask user for exemption or add missing scenario
---
## Scenarios for API-ONLY projects
### E2E-API-{NNN}-01: {Workflow title} — Happy Path
- **Workflow:** WF-{NNN}
- **Use Cases:** UC-{NNN}, UC-{NNN}
- **Type:** API E2E (no browser)
#### Request Body Field Inventory
| Field | Required | Type | Validation | Source |
|-------|----------|------|-----------|--------|
| {field1} | Yes | {type} | {rules} | API-{NNN}, UC-{NNN} |
#### Steps
| # | Method | Endpoint | Body/Params | Assert status | Assert body | Spec Ref |
|---|--------|----------|-------------|---------------|-------------|----------|
| 1 | POST | /api/{resource} | {ALL required fields} | 201 | {schema} | API-{NNN} |
| 2 | GET | /api/{resource}/{id} | — | 200 | {all fields present} | API-{NNN} |
#### Required-Field Validation (API)
| Variant | Missing field | Assert status | Assert body | Spec Ref |
|---------|--------------|---------------|-------------|----------|
| E2E-API-{NNN}-V01 | {field1} | 400 | error.field = "{field1}" | API-{NNN} §validation |
#### Invalid-Value Validation (API)
| Variant | Field | Invalid value | Assert status | Assert body | Spec Ref |
|---------|-------|---------------|---------------|-------------|----------|
| E2E-API-{NNN}-IV01 | {field1} | {invalid} | 400/422 | error: "{message}" | API-{NNN} §validation |
---
## Coverage Matrix
| REQ ID | Type | E2E Coverage | Justification if excluded |
|--------|------|-------------|---------------------------|
| REQ-FUNC-{NNN} | UI-func | E2E-WF-{NNN}-01 + {N} variations | — |
| REQ-FUNC-{NNN} | API-only | — | EXEMPT-BACKEND: no user-facing flow |
| REQ-NFR-{NNN} | Perf | — | EXEMPT-NFR: covered by PERF-SCENARIOS.md |
| REQ-FUNC-{NNN} | UI-func | — | GAP: needs WF or E2E scenario |
Key Principles
Test Independence
Each test must be independent — no shared mutable state, no execution order dependency. SWEBOK v4 Ch04 §1.
Traceability
Every test traces to a spec element (UC, INV, NFR, API contract). No test exists without a spec justification. No spec element exists without a test.
Risk-Based Prioritization
Not all tests are equal. Prioritize by:
- Business criticality of the UC
- Failure impact (data loss > UX issue)
- Probability of defect (complex logic > simple CRUD)
Shift-Left Testing
Test planning happens at spec time, not at implementation time. This skill exists precisely to move testing left in the pipeline.
Pipeline Integration
This skill is Step 3.5 of the SDD pipeline (between spec-auditor and plan-architect):
sdd-requirements-engineer → requirements/REQUIREMENTS.md
↓
sdd-specifications-engineer → spec/
↓
sdd-spec-auditor → audits/AUDIT-BASELINE.md
↓
sdd-test-planner → test/TEST-PLAN.md, test/TEST-MATRIX-*.md, test/PERF-SCENARIOS.md, test/E2E-SCENARIOS.md (THIS SKILL)
↓
sdd-plan-architect → plan/
↓
sdd-task-generator → task/ (includes test tasks from test plan)
↓
sdd-task-implementer → src/, tests/
Input: spec/ (audit-clean), optionally audits/SECURITY-AUDIT-BASELINE.md, optionally ux/ (enriches E2E scenarios)
Output: test/TEST-PLAN.md, test/TEST-MATRIX-UC-*.md, test/PERF-SCENARIOS.md, test/E2E-SCENARIOS.md
Next step: Run sdd-plan-architect which reads test strategy for FASE planning
Persist Summary
After generating all output artifacts, update pipeline-state.json:
- Read
pipeline-state.json from project root (create if absent with default stage structure)
- Set
stages["test-planner"].status = "done"
- Set
stages["test-planner"].lastRun = current ISO-8601
- Set
stages["test-planner"].summary:
artifacts: list of files created in test/ with labels (e.g., {"file": "test/TEST-PLAN.md", "label": "Test Strategy"})
metrics: { "bdd_scenarios": N, "test_matrices": N, "perf_scenarios": N, "e2e_scenarios": N, "e2e_fields_total": N, "e2e_fields_complete": N, "e2e_field_coverage_pct": N, "invariants_mapped": N, "test_gaps": N }
highlights: top 3-5 notable observations (e.g., "101 BDD scenarios cover 85% of requirements", "3 gaps in NFR testing")
nextStep: "Run /sdd-plan-architect"
generatedAt: current ISO-8601
- Write updated
pipeline-state.json
- Display summary table to user (console output)
Output Language
Respond in the same language the user uses. If the user writes in Spanish, respond in Spanish. If in English, respond in English.
Source: noelserdna/claude-plugin-sdd — distributed by TomeVault.
1---2name: noelserdna-claude-plugin-sdd-test-planner3description: SDD Test Planner Skill4---56# SDD Test Planner Skill78> **Principio:** Un plan de testing no es una lista de tests — es una estrategia que garantiza que cada requisito,9> cada invariante y cada contrato tiene verificación adecuada en el tipo, nivel y momento correcto.10> SWEBOK v4 Ch04: "Testing is the dynamic verification that a program provides expected behaviors."1112## Purpose1314Generate comprehensive test strategies, test matrices, performance scenarios, and E2E acceptance scenarios from specification documents. Bridge the gap between BDD scenarios (in `spec/tests/`) and actionable test tasks (in `task/`), including end-to-end user journey validation.1516## When to Use This Skill1718- Specifications exist in `spec/` and have been audited by `sdd-spec-auditor`19- You need a test strategy before generating implementation plans20- You want to define test coverage targets per FASE21- You need performance test scenarios derived from NFRs22- You want to audit test completeness of existing BDD specs23- You want to generate test matrices for complex use cases24- You need E2E acceptance scenarios derived from workflows (WF-*)2526## When NOT to Use This Skill2728- To write or execute tests → use `sdd-task-implementer`29- To audit specs for quality → use `sdd-spec-auditor`30- To generate task files → use `sdd-task-generator`31- To create specs → use `sdd-specifications-engineer`3233## Relationship to Other Skills3435| Skill | Relationship |36|-------|-------------|37| `sdd-specifications-engineer` | **Upstream**: produces `spec/tests/BDD-*.md` and `spec/nfr/*.md` |38| `sdd-spec-auditor` | **Upstream**: validates spec quality before test planning |39| `sdd-security-auditor` | **Lateral**: security findings feed into security test scenarios |40| `sdd-ux-designer` | **Lateral (optional)**: enriches E2E scenarios with page objects and a11y assertions |41| **`sdd-test-planner`** | **THIS SKILL**: produces test strategy, matrices, and E2E scenarios |42| `sdd-plan-architect` | **Downstream**: consumes test strategy for FASE planning |43| `sdd-task-generator` | **Downstream**: consumes test matrices to generate test tasks |4445### Pipeline Position4647```48Requisitos → sdd-specifications-engineer → sdd-spec-auditor →49 ↓50 sdd-test-planner ← YOU ARE HERE51 ↓52 sdd-plan-architect53 ↓54 sdd-task-generator55 ↓56 sdd-task-implementer5758Lateral: sdd-security-auditor → feeds security test scenarios59Lateral: sdd-ux-designer → enriches E2E scenarios (optional)60```6162> **SWEBOK v4 alignment:**63> - Ch04 §1: Testing Fundamentals (levels, types, techniques)64> - Ch04 §2: Test Process (planning, design, execution, evaluation)65> - Ch04 §3: Test Techniques (black-box, white-box, experience-based)66> - Ch04 §4: Test Measurement (coverage, defect metrics)67> - Ch04 §5: Test Management (planning, estimation, monitoring)6869---7071## Modes of Operation7273### Mode 1: Generate Test Strategy7475Use when the user wants a comprehensive test plan for the project.7677**Readiness Gates:**78- G1: `spec/` directory exists with at least `domain/`, `use-cases/`, `contracts/`79- G2: `spec/tests/BDD-*.md` files exist (at least partially)80- G3: `spec/nfr/*.md` files exist (at least PERFORMANCE.md)8182**Process:**83841. **Read all specification documents:**85 - `spec/use-cases/UC-*.md` → extract main flows, exception flows, actors86 - `spec/tests/BDD-*.md` → extract existing BDD scenarios87 - `spec/nfr/PERFORMANCE.md` → extract performance targets88 - `spec/nfr/SECURITY.md` → extract security requirements89 - `spec/nfr/LIMITS.md` → extract rate limits and thresholds90 - `spec/domain/05-INVARIANTS.md` → extract all invariants91 - `spec/contracts/API-*.md` → extract endpoint contracts92 - `spec/contracts/EVENTS-*.md` → extract event schemas93 - `audits/SECURITY-AUDIT-BASELINE.md` → extract security findings (if exists)94952. **Classify test types needed per spec element:**9697 | Spec Element | Test Types | Level |98 |-------------|------------|-------|99 | Entity invariants (INV-*) | Unit tests (property-based) | Unit |100 | UC main flows | BDD scenarios (Given/When/Then) | Integration |101 | UC exception flows | Negative BDD scenarios | Integration |102 | API contracts | Contract tests (request/response schema) | Integration |103 | Event schemas | Event contract tests (schema validation) | Integration |104 | Workflows (WF-*) | End-to-end scenarios | E2E |105 | NFR Performance | Load tests, stress tests | Performance |106 | NFR Security | Penetration tests, auth bypass tests | Security |107 | NFR Limits | Rate limit tests, quota enforcement | Integration |108 | Cross-UC flows | Saga/choreography tests | E2E |1091103. **Identify gaps in existing BDD specs:**111 - UCs without BDD file → flag as `MISSING-BDD`112 - UCs with BDD but missing exception flows → flag as `INCOMPLETE-BDD`113 - Invariants without property tests → flag as `MISSING-PROPERTY-TEST`114 - NFRs without measurable test scenarios → flag as `MISSING-NFR-TEST`115 - WFs without E2E scenarios → flag as `MISSING-E2E` (addressed by Mode 5)1161174. **Define coverage targets per FASE:**118 - Ask user for overall coverage target (recommend 80% minimum)119 - Map test types to FASEs using `plan/fases/FASE-*.md` (if exists)120 - If plan doesn't exist yet, group by bounded context1211225. **Generate `test/TEST-PLAN.md`:**123124```markdown125# Test Plan126127> **Project:** {project name}128> **Version:** {X.Y}129> **Generated from:** spec/ (audit-clean)130> **SWEBOK alignment:** Ch04 — Software Testing131132## Test Strategy Summary133134| Metric | Target | Current |135|--------|--------|---------|136| BDD scenario coverage (UCs) | 100% of main + exception flows | {N}% |137| Invariant test coverage | 100% of INV-* | {N}% |138| Contract test coverage | 100% of API endpoints | {N}% |139| NFR test coverage | 100% of measurable NFRs | {N}% |140| Security test coverage | 100% of OWASP Top 10 applicable | {N}% |141| E2E workflow coverage | 100% of user-facing WF-* | {N}% |142143## Test Levels144145### Unit Tests146- **Scope:** Entity invariants, value object validation, pure business logic147- **Technique:** Property-based testing for invariants, example-based for logic148- **Framework:** {recommend based on tech stack or ask user}149- **Coverage target:** {N}% line coverage on domain layer150151### Integration Tests152- **Scope:** UC flows via API endpoints, event handling, database operations153- **Technique:** BDD scenarios (Given/When/Then), contract testing154- **Data:** Test fixtures derived from spec entity schemas155- **Coverage target:** 100% of UC main flows, {N}% of exception flows156157### End-to-End Tests158- **Scope:** Multi-UC workflows, cross-service user journeys159- **Technique:** Scenario-based testing following WF-* specs (see `test/E2E-SCENARIOS.md` if Mode 5 was run)160- **Framework:** Playwright recommended (browser), APIRequestContext (API-only), subprocess (CLI)161- **Environment:** Staging environment with test data, isolated browser contexts162- **Data strategy:** {transaction-rollback | snapshot-restore | unique-per-test}163- **Accessibility:** axe-core scan at each navigation step (WCAG 2.1 AA)164- **Coverage target:** 100% of user-facing WF-* workflows165- **Tiered execution:**166 - Smoke (P0 happy paths): every PR, < 2 min167 - Critical (P0+P1): every merge to main, < 10 min168 - Full E2E suite: nightly / release, < 30 min169170### Performance Tests171- **Scope:** Response time (p99), throughput, concurrent users172- **Technique:** Load testing, stress testing, soak testing173- **Targets:** From spec/nfr/PERFORMANCE.md174- **Schedule:** Run on every FASE completion175176### Security Tests177- **Scope:** Authentication bypass, authorization escalation, injection, data exposure178- **Technique:** OWASP ASVS v4 checklist + automated scanning179- **Targets:** From spec/nfr/SECURITY.md + security audit findings180181## Test Gaps Identified182183| Gap ID | Type | Spec Element | Missing Test | Priority |184|--------|------|-------------|--------------|----------|185| GAP-001 | MISSING-BDD | UC-{NNN} | No BDD file exists | High |186| GAP-002 | INCOMPLETE-BDD | UC-{NNN} | Exception flow {N} not covered | Medium |187| GAP-003 | MISSING-PROPERTY-TEST | INV-{PREFIX}-{NNN} | No property test defined | Medium |188| GAP-004 | MISSING-NFR-TEST | PERFORMANCE p99 target | No load test scenario | High |189| GAP-005 | MISSING-E2E | WF-{NNN} | No E2E scenario for user-facing workflow | High |190191## Per-FASE Test Targets192193| FASE | Unit Tests | Integration Tests | E2E Tests | Perf Tests |194|------|-----------|-------------------|-----------|------------|195| FASE-0 | INV-SYS-* | Auth flows | Health check | Baseline |196| FASE-1 | INV-{PREFIX}-* | UC-{NNN} flows | WF-{NNN} | Load targets |197| ... | ... | ... | ... | ... |198199## Regression Strategy200201- **On every commit:** Unit tests + affected integration tests202- **On FASE completion:** Full integration + E2E suite203- **On release candidate:** Full suite + performance + security204```205206---207208### Mode 2: Generate Test Matrices209210Use when the user wants detailed input/output matrices for complex use cases.211212**Process:**2132141. **Read target UC spec** (`spec/use-cases/UC-NNN-*.md`)2152. **Extract inputs:** All parameters, preconditions, actor roles2163. **Apply test design techniques** (SWEBOK v4 Ch04 §3):217218 **a. Equivalence Partitioning:**219 - For each input, identify valid and invalid partitions220 - Select one representative value per partition221222 **b. Boundary Value Analysis:**223 - For each numeric/range input, identify boundary values224 - Include: min-1, min, min+1, max-1, max, max+1225226 **c. Decision Table:**227 - For UCs with multiple conditions, build condition/action table228 - Each row = one test case229230 **d. State Transition:**231 - For entities with state machines (`spec/domain/04-STATES.md`)232 - Generate tests for each valid transition AND each invalid transition2332344. **Generate `test/TEST-MATRIX-UC-{NNN}.md`:**235236```markdown237# Test Matrix: UC-{NNN} — {title}238239## Inputs240241| Input | Type | Valid Partitions | Invalid Partitions | Boundaries |242|-------|------|------------------|--------------------|------------|243| {param} | {type} | {valid ranges} | {invalid values} | {boundary values} |244245## Decision Table246247| # | Cond1 | Cond2 | Cond3 | Expected Action | Expected Status |248|---|-------|-------|-------|-----------------|-----------------|249| T1 | true | true | true | {action} | {status} |250| T2 | true | true | false | {action} | {status} |251| ... | | | | | |252253## State Transition Tests (if applicable)254255| Current State | Event | Expected Next State | Postconditions |256|---------------|-------|---------------------|----------------|257| {state} | {event} | {next_state} | {postconditions} |258| {state} | {invalid_event} | {same_state} | Error: {message} |259260## Traceability261262| Test Case | Covers | Spec Ref |263|-----------|--------|----------|264| T1 | Main flow step 3 | UC-{NNN} §main.3 |265| T2 | Exception flow 1 | UC-{NNN} §exception.1 |266```267268---269270### Mode 3: Generate Performance Scenarios271272Use when the user needs performance test scenarios derived from NFR specs.273274**Process:**2752761. **Read NFR documents:**277 - `spec/nfr/PERFORMANCE.md` → response time targets, throughput278 - `spec/nfr/LIMITS.md` → rate limits, quotas, thresholds279 - `spec/contracts/API-*.md` → endpoint patterns and expected load2802812. **Generate scenarios per NFR target:**282283 | Scenario Type | Purpose | Duration |284 |---------------|---------|----------|285 | **Smoke** | Verify baseline functionality under minimal load | 1 min |286 | **Load** | Verify p99 targets under expected concurrent users | 10 min |287 | **Stress** | Find breaking point beyond expected load | 15 min |288 | **Soak** | Detect memory leaks under sustained load | 1 hour |289 | **Spike** | Verify recovery from sudden traffic bursts | 5 min |2902913. **Generate `test/PERF-SCENARIOS.md`:**292293```markdown294# Performance Test Scenarios295296> Derived from: spec/nfr/PERFORMANCE.md, spec/nfr/LIMITS.md297298## Targets (from specs)299300| Metric | Target | Source |301|--------|--------|--------|302| API response time (p99) | < {N}ms | PERFORMANCE.md |303| Throughput | {N} req/s | PERFORMANCE.md |304| Concurrent users | {N} | PERFORMANCE.md |305| Rate limit (per user) | {N} req/min | LIMITS.md |306307## Scenarios308309### PERF-001: API Load Test310- **Type:** Load311- **Target endpoint:** {most critical endpoint from contracts}312- **Concurrent users:** {from NFR}313- **Duration:** 10 minutes314- **Success criteria:** p99 < {target}ms, 0% error rate315- **Ramp-up:** Linear over 2 minutes316317### PERF-002: Rate Limit Enforcement318- **Type:** Stress319- **Target:** Rate limit threshold320- **Method:** Single user exceeding {N} req/min321- **Success criteria:** 429 returned after limit, Retry-After header present322323### PERF-003: Database Query Performance324- **Type:** Load325- **Target:** Queries with complex joins or full-text search326- **Dataset:** {N} records (10x expected production size)327- **Success criteria:** p99 < {target}ms328```329330---331332### Mode 4: Audit Test Coverage333334Use when the user wants to verify that existing test specs are complete.335336**Process:**3373381. **Build traceability matrix:**339 - List ALL UCs, invariants, contracts, workflows, NFRs340 - For each, check if a corresponding test exists in `spec/tests/`3413422. **Compute coverage metrics:**343344 | Dimension | Formula | Target |345 |-----------|---------|--------|346 | UC Coverage | UCs with BDD / total UCs | 100% |347 | Exception Coverage | Exception flows tested / total exception flows | ≥ 80% |348 | Invariant Coverage | INVs with property tests / total INVs | 100% |349 | Contract Coverage | Endpoints with contract tests / total endpoints | 100% |350 | NFR Coverage | Measurable NFRs with test scenarios / total measurable NFRs | 100% |351 | E2E Coverage | User-facing WFs with E2E scenarios / total user-facing WFs | 100% |3523533. **Output coverage report with gaps and recommendations**354355---356357### Mode 5: Generate E2E Acceptance Scenarios358359Use when the user needs end-to-end acceptance test scenarios that validate complete user journeys through the system. Produces actionable scenarios traceable from workflows back to requirements.360361**Readiness Gates:**362- G1: `spec/workflows/WF-*.md` files exist (at least one)363- G2: `spec/use-cases/UC-*.md` files exist364- G3: `spec/tests/BDD-*.md` files exist (at least partially)365366**Process:**3673681. **Detect project type:**369370 ```371 IF ux/ directory exists AND ux/WIREFRAMES.md is present:372 → project_type = WEB-APP (full browser E2E with page objects)373 ELIF spec/contracts/API-*.md exists AND no ux/:374 → project_type = API-ONLY (API E2E via HTTP, no browser)375 ELIF project is CLI tool (detected from plan/ARCHITECTURE.md or CLAUDE.md):376 → project_type = CLI (subprocess E2E)377 ELSE:378 → project_type = LIBRARY (skip E2E, document exemption)379 ```380381 If `project_type = LIBRARY`, output a note in TEST-PLAN.md explaining E2E exemption and stop.3823832. **Read workflow and spec artifacts:**384 - `spec/workflows/WF-*.md` → extract user journeys, steps, actors, cross-UC flows385 - `spec/use-cases/UC-*.md` → extract main flows, exception flows, **ALL input parameters with types and required/optional**386 - `spec/tests/BDD-*.md` → extract existing acceptance criteria (reuse, don't duplicate)387 - `spec/contracts/API-*.md` → extract endpoints involved in each workflow, **including ALL request body fields with required/optional and validation rules**388 - `requirements/REQUIREMENTS.md` → build transitive REQ→UC→WF mapping for traceability3893903. **Read UX artifacts (if `project_type = WEB-APP` and `ux/` exists):**391 - `ux/WIREFRAMES.md` → extract component inventory, interactive elements per screen392 - `ux/INTERACTION-MODEL.md` → extract state diagrams, loading states, error states, **conditional visibility rules**393 - `ux/ACCESSIBILITY-SPEC.md` → extract keyboard navigation matrix, ARIA mappings3943954. **Build field inventory per workflow (MANDATORY):**396397 For each WF-* that will have E2E scenarios, enumerate ALL fields from three sources and cross-reference them:398399 ```400 WF-007 Field Inventory (from UC-003, API-SRV-01, WIREFRAMES §WF-007):401 | Field | UC param | API field | Wireframe element | Required | Type | Validation rules | Conditional? |402 |--------------|----------|-----------|----------------------------|----------|-----------|--------------------------|--------------|403 | clienteId | UC-003.1 | body.clienteId | Cliente [v Buscar...] | Yes | select | Must exist in system | No |404 | tipoServicio | UC-003.2 | body.tipo | (o) Fibra ( ) Movil | Yes | radio | enum: fibra, movil | No |405 | velocidad | UC-003.3 | body.velocidad | Velocidad [v 300Mb...] | Yes | select | depends on tipoServicio | Yes: only when tipoServicio=fibra |406 | ... | ... | ... | ... | ... | ... | ... | ... |407 ```408409 **Cross-validation rules (STOP on ERROR, warn on WARN):**410 - `V-FIELD-01` (ERROR): Every `required` field in the API contract MUST appear in the inventory with a UC param source411 - `V-FIELD-02` (ERROR): Every UC input parameter MUST appear in the inventory412 - `V-FIELD-03` (ERROR): Every interactive input element in the wireframe MUST appear in the inventory (buttons excluded — only data-entry elements)413 - `V-FIELD-04` (WARN): A field in UC/API but not in the wireframe → flag as `MISSING-UI` for user review414 - `V-FIELD-05` (WARN): A wireframe element not in UC/API → flag as `UI-ONLY`, may need interaction step415416 **If any ERROR is found, present the table to the user and STOP. This is a spec inconsistency that must be resolved before generating scenarios.**4174185. **Build field behavioral matrix (MANDATORY):**419420 For each field in the inventory, define the behavioral scenarios it requires:421422 ```423 WF-007 Field Behavioral Matrix:424 | Field | VALID | EMPTY | INVALID | BOUNDARY | CONDITIONAL |425 |--------------|--------------------|--------------------|-----------------------|--------------------|--------------------------------------|426 | clienteId | Select existing | Submit without → | Non-existent ID → | — | — |427 | | client → proceed | blocked/error msg | error msg | | |428 | tipoServicio | Select fibra → | Submit without → | — | — | fibra → show velocidad, plan fields |429 | | show fibra fields | blocked/error msg | | | movil → show linea, portab fields |430 | velocidad | Select 300Mb → | Submit without → | — | — | Only visible when tipoServicio=fibra |431 | | proceed | blocked/error msg | | | Hidden when tipoServicio=movil |432 ```433434 Behavioral categories:435 - **VALID**: Standard happy-path value → expected positive behavior436 - **EMPTY**: Required field left blank → expected validation error or submit block437 - **INVALID**: Wrong type, format, or value → expected validation error message438 - **BOUNDARY**: Edge values (min/max length, min/max numeric) → reuse from TEST-MATRIX if exists439 - **CONDITIONAL**: Field visibility/value changes triggered by other fields → test that field appears/disappears/resets correctly440441 **Rules:**442 - Every required field MUST have at least VALID + EMPTY behaviors defined443 - Every field with validation rules MUST have at least one INVALID behavior444 - Every field marked `Conditional? = Yes` MUST have CONDITIONAL behaviors for each trigger value445 - Fields with interactions (e.g., selecting client loads client data) MUST document the interaction chain4464476. **Generate E2E scenarios from field behavioral matrix:**448449 For each WF-* that involves user interaction, generate scenarios **driven by the field behavioral matrix**, not by narrative walkthrough:450451 **a. Happy path scenario (P0):**452 - One step per field in the inventory (ALL of them), filled with VALID values in the order they appear in the wireframe453 - Final submit and assert postcondition454 - **Every MAPPED field MUST have a Fill/Select/Click step.** If a field is missing from the steps, the scenario is incomplete.455456 **b. Required-field validation scenarios (P0):**457 - For each required field: leave it empty, fill all others with valid values, attempt submit458 - Assert: specific validation error message for that field (from UC exception flows or API 400 response)459 - Combine into a variation table when possible (one row per required field)460461 **c. Invalid-value scenarios (P1):**462 - For each field with INVALID behaviors in the matrix: fill with invalid value, fill all others with valid values, attempt submit463 - Assert: specific validation error for that field464 - Combine into a variation table465466 **d. Conditional behavior scenarios (P1):**467 - For each CONDITIONAL field: test that changing the trigger field correctly shows/hides/resets dependent fields468 - Example: select tipoServicio=fibra → assert velocidad field appears; switch to movil → assert velocidad disappears and linea field appears469 - Include "field reset" behavior: if user fills conditional fields, then changes trigger → conditional fields should reset470471 **e. Field interaction scenarios (P1):**472 - For each field interaction chain: test the full chain473 - Example: select clienteId → client data loads → dependent fields auto-populate474475 **f. UC exception flow scenarios (P1/P2):**476 - One row per exception flow in the constituent UCs (as before)477 - These are ADDITIONAL to field-level scenarios — they cover business logic errors, not field validation478479 **g. Accessibility gate:**480 - axe-core scan at each major navigation step481 - Keyboard-only form completion (tab through all fields, submit with Enter)4824837. **Post-generation completeness check (MANDATORY):**484485 After generating all scenarios, build and output this verification matrix:486487 ```488 WF-007 Field Coverage Verification:489 | Field | Happy path step? | Empty variation? | Invalid variation? | Conditional tested? | Interaction tested? | Status |490 |--------------|-----------------|------------------|-------------------|--------------------|--------------------|--------|491 | clienteId | Step 3 ✅ | Var E2E-02 ✅ | Var E2E-05 ✅ | N/A | E2E-WF-007-05 ✅ | COMPLETE |492 | tipoServicio | Step 4 ✅ | Var E2E-03 ✅ | N/A | E2E-WF-007-04 ✅ | N/A | COMPLETE |493 | velocidad | Step 5 ✅ | Var E2E-04 ✅ | N/A | E2E-WF-007-04 ✅ | N/A | COMPLETE |494 ```495496 **Completeness rules:**497 - Every required field MUST have: happy path step + empty variation → otherwise status = `INCOMPLETE`498 - Every field with validation rules MUST have: invalid variation → otherwise status = `INCOMPLETE`499 - Every conditional field MUST have: conditional scenario → otherwise status = `INCOMPLETE`500 - If ANY field has status `INCOMPLETE`, flag as finding and ask user whether to add the missing scenario or document exemption with justification5015028. **Build transitive coverage matrix:**503504 Map each E2E scenario back to the REQs it covers transitively:505 ```506 E2E-WF-001-01 → WF-001 → {UC-003, UC-004} → {REQ-FUNC-010, REQ-FUNC-011}507 ```508509 For REQs not covered by any E2E scenario, classify as:510 - `EXEMPT-BACKEND`: Internal/infrastructure REQ, no user-facing flow511 - `EXEMPT-NFR`: Non-functional REQ, covered by performance/security tests512 - `GAP`: User-facing REQ with no transitive E2E coverage → flag for review5135149. **Generate `test/E2E-SCENARIOS.md`:**515516```markdown517# E2E Acceptance Scenarios518519> **Project:** {project name}520> **Project type:** {WEB-APP | API-ONLY | CLI}521> **Generated from:** spec/workflows/, spec/use-cases/, spec/contracts/522> **UX enrichment:** {Yes — from ux/ | No — abstract scenarios}523524## E2E Strategy525526| Dimension | Value |527|-----------|-------|528| Framework | Playwright (recommended) |529| Selector strategy | getByRole > getByLabel > getByText > getByTestId (fallback) |530| Auth strategy | storageState reuse (1 login test, others reuse state) |531| Data strategy | {transaction-rollback | snapshot-restore | unique-per-test} |532| Accessibility | axe-core scan at each navigation (WCAG 2.1 AA) |533| Parallelism | Playwright sharding across {N} workers |534535### Tiered Execution536537| Tier | Scenarios | Run time | Trigger |538|------|-----------|----------|---------|539| Smoke | P0 happy paths only | < 2 min | Every PR |540| Critical | P0 + P1 paths | < 10 min | Every merge to main |541| Full | All E2E scenarios | < 30 min | Nightly / release |542543### Viewport Matrix (WEB-APP only, derived from ux/DESIGN-TOKENS.json)544545| Viewport | Width | Run |546|----------|-------|-----|547| Mobile | 375px | P0 + P1 scenarios |548| Desktop | 1280px | All scenarios |549550---551552## Field Inventory: WF-{NNN}553554> Cross-referenced from: UC-{NNN} params, API-{NNN} body, WIREFRAMES §{screen}555556| Field | UC param | API field | Wireframe element | Required | Type | Validation rules | Conditional? |557|-------|----------|-----------|-------------------|----------|------|-----------------|--------------|558| {field1} | UC-{NNN}.1 | body.{f1} | {element desc} | Yes | {type} | {rules} | No |559| {field2} | UC-{NNN}.2 | body.{f2} | {element desc} | Yes | {type} | {rules} | Yes: when {trigger} |560| ... | ... | ... | ... | ... | ... | ... | ... |561562### Field Behavioral Matrix: WF-{NNN}563564| Field | VALID | EMPTY | INVALID | BOUNDARY | CONDITIONAL |565|-------|-------|-------|---------|----------|-------------|566| {field1} | {valid action → expected result} | {submit without → expected error} | {bad value → expected error} | {edge values if applicable} | {N/A or trigger→effect} |567| {field2} | {valid action → expected result} | {submit without → expected error} | {N/A or bad value → error} | {N/A or edge values} | {trigger changes → field shows/hides/resets} |568569---570571## Scenarios572573### E2E-WF-{NNN}-01: {Workflow title} — Happy Path (P0)574575- **Workflow:** WF-{NNN}576- **Use Cases:** UC-{NNN}, UC-{NNN}577- **Requirements (transitive):** REQ-FUNC-{NNN}, REQ-FUNC-{NNN}578- **Priority:** P0579- **Tier:** smoke580- **Auth fixture:** {authenticated | admin | unauthenticated}581- **Fields covered:** ALL ({N} fields from inventory)582583#### Elements Referenced (when ux/ exists)584585| Element | Locator hint | Source |586|---------|-------------|--------|587| {name} | getByRole("{role}", { name: /{pattern}/i }) | WIREFRAMES §{screen} |588| {name} | getByLabel("{label}") | WIREFRAMES §{screen} |589590#### Steps591592> One step per field in inventory, in wireframe presentation order. No field may be skipped.593594| # | Action | Target | Assertion | Spec Ref |595|---|--------|--------|-----------|----------|596| 1 | Navigate to {url} | — | Page title = "{title}" | WF-{NNN} step 1 |597| 2 | axe-core scan | full page | No violations | ACCESSIBILITY-SPEC |598| 3 | Fill/Select {field1} | {element} | Field accepts input, {interaction effect if any} | UC-{NNN} §main.{N} |599| 4 | Fill/Select {field2} | {element} | Field accepts input, {conditional fields appear if applicable} | UC-{NNN} §main.{N} |600| ... | (one step per field from inventory) | ... | ... | ... |601| N | Click submit | {button} | {expected success feedback} | UC-{NNN} §main.{N} |602| N+1 | Assert final state | — | {postcondition} | WF-{NNN} postcondition |603604### E2E-WF-{NNN} — Required-Field Validation (P0)605606> One variation per required field. All other fields filled with valid values.607608| Variant ID | Empty field | Other fields | Action | Expected behavior | Spec Ref |609|------------|-------------|-------------|--------|-------------------|----------|610| E2E-WF-{NNN}-V01 | {field1} | All valid | Submit | Error: "{validation message}" | UC-{NNN} §exception.{N} |611| E2E-WF-{NNN}-V02 | {field2} | All valid | Submit | Error: "{validation message}" | UC-{NNN} §exception.{N} |612613### E2E-WF-{NNN} — Invalid-Value Scenarios (P1)614615> One variation per field with validation rules. All other fields filled with valid values.616617| Variant ID | Field | Invalid value | Other fields | Expected behavior | Spec Ref |618|------------|-------|---------------|-------------|-------------------|----------|619| E2E-WF-{NNN}-IV01 | {field} | {invalid value} | All valid | Error: "{validation message}" | UC-{NNN} §exception.{N} |620621### E2E-WF-{NNN} — Conditional Behavior Scenarios (P1)622623> One scenario per conditional field trigger. Tests visibility, reset, and dependent field behavior.624625| Variant ID | Trigger field | Trigger value | Expected effect | Reset tested? | Spec Ref |626|------------|---------------|---------------|-----------------|---------------|----------|627| E2E-WF-{NNN}-CD01 | {trigger} | {value1} | {fields shown/hidden, values reset} | Yes | UC-{NNN} §main.{N}, INTERACTION-MODEL §{state} |628| E2E-WF-{NNN}-CD02 | {trigger} | {value2} | {different fields shown/hidden} | Yes | UC-{NNN} §main.{N} |629630### E2E-WF-{NNN} — Field Interaction Scenarios (P1)631632> Tests interaction chains where one field's value affects others (auto-populate, cascading selects, etc.)633634| Variant ID | Source field | Action | Affected fields | Expected effect | Spec Ref |635|------------|-------------|--------|-----------------|-----------------|----------|636| E2E-WF-{NNN}-FI01 | {field} | {select value} | {field2, field3} | {auto-populated/filtered/enabled} | UC-{NNN} §main.{N} |637638### E2E-WF-{NNN} — UC Exception Flows (P1/P2)639640> Business logic errors beyond field validation (e.g., duplicate detection, insufficient permissions, external service failures).641642| Variant ID | Diverges at step | Input change | Expected behavior | Spec Ref |643|------------|------------------|-------------|-------------------|----------|644| E2E-WF-{NNN}-EX01 | Step {N} | {precondition not met} | {error/redirect/fallback} | UC-{NNN} §exception.{N} |645646### E2E-WF-{NNN} — Accessibility (P1)647648> Keyboard-only and screen-reader scenarios.649650| Variant ID | Scenario | Steps | Assertion | Spec Ref |651|------------|----------|-------|-----------|----------|652| E2E-WF-{NNN}-A11Y-01 | Keyboard-only completion | Tab through all {N} fields, fill each, Enter to submit | All fields reachable, submit succeeds | ACCESSIBILITY-SPEC |653654---655656## Field Coverage Verification657658> Post-generation completeness check. Every field MUST have COMPLETE status.659660### WF-{NNN}661662| Field | Happy path step? | Empty variation? | Invalid variation? | Conditional tested? | Interaction tested? | Status |663|-------|-----------------|------------------|-------------------|--------------------|--------------------|--------|664| {field1} | Step {N} ✅ | V01 ✅ | IV01 ✅ | N/A | FI01 ✅ | COMPLETE |665| {field2} | Step {N} ✅ | V02 ✅ | N/A | CD01 ✅ | N/A | COMPLETE |666667**Completeness rules:**668- Required field without empty variation → `INCOMPLETE`669- Field with validation rules without invalid variation → `INCOMPLETE`670- Conditional field without conditional scenario → `INCOMPLETE`671- Any `INCOMPLETE` → flag as finding, ask user for exemption or add missing scenario672673---674675## Scenarios for API-ONLY projects676677### E2E-API-{NNN}-01: {Workflow title} — Happy Path678679- **Workflow:** WF-{NNN}680- **Use Cases:** UC-{NNN}, UC-{NNN}681- **Type:** API E2E (no browser)682683#### Request Body Field Inventory684685| Field | Required | Type | Validation | Source |686|-------|----------|------|-----------|--------|687| {field1} | Yes | {type} | {rules} | API-{NNN}, UC-{NNN} |688689#### Steps690691| # | Method | Endpoint | Body/Params | Assert status | Assert body | Spec Ref |692|---|--------|----------|-------------|---------------|-------------|----------|693| 1 | POST | /api/{resource} | {ALL required fields} | 201 | {schema} | API-{NNN} |694| 2 | GET | /api/{resource}/{id} | — | 200 | {all fields present} | API-{NNN} |695696#### Required-Field Validation (API)697698| Variant | Missing field | Assert status | Assert body | Spec Ref |699|---------|--------------|---------------|-------------|----------|700| E2E-API-{NNN}-V01 | {field1} | 400 | error.field = "{field1}" | API-{NNN} §validation |701702#### Invalid-Value Validation (API)703704| Variant | Field | Invalid value | Assert status | Assert body | Spec Ref |705|---------|-------|---------------|---------------|-------------|----------|706| E2E-API-{NNN}-IV01 | {field1} | {invalid} | 400/422 | error: "{message}" | API-{NNN} §validation |707708---709710## Coverage Matrix711712| REQ ID | Type | E2E Coverage | Justification if excluded |713|--------|------|-------------|---------------------------|714| REQ-FUNC-{NNN} | UI-func | E2E-WF-{NNN}-01 + {N} variations | — |715| REQ-FUNC-{NNN} | API-only | — | EXEMPT-BACKEND: no user-facing flow |716| REQ-NFR-{NNN} | Perf | — | EXEMPT-NFR: covered by PERF-SCENARIOS.md |717| REQ-FUNC-{NNN} | UI-func | — | GAP: needs WF or E2E scenario |718```719720---721722## Key Principles723724### Test Independence725Each test must be independent — no shared mutable state, no execution order dependency. SWEBOK v4 Ch04 §1.726727### Traceability728Every test traces to a spec element (UC, INV, NFR, API contract). No test exists without a spec justification. No spec element exists without a test.729730### Risk-Based Prioritization731Not all tests are equal. Prioritize by:7321. **Business criticality** of the UC7332. **Failure impact** (data loss > UX issue)7343. **Probability of defect** (complex logic > simple CRUD)735736### Shift-Left Testing737Test planning happens at spec time, not at implementation time. This skill exists precisely to move testing left in the pipeline.738739---740741## Pipeline Integration742743This skill is **Step 3.5** of the SDD pipeline (between spec-auditor and plan-architect):744745```746sdd-requirements-engineer → requirements/REQUIREMENTS.md747 ↓748sdd-specifications-engineer → spec/749 ↓750sdd-spec-auditor → audits/AUDIT-BASELINE.md751 ↓752sdd-test-planner → test/TEST-PLAN.md, test/TEST-MATRIX-*.md, test/PERF-SCENARIOS.md, test/E2E-SCENARIOS.md (THIS SKILL)753 ↓754sdd-plan-architect → plan/755 ↓756sdd-task-generator → task/ (includes test tasks from test plan)757 ↓758sdd-task-implementer → src/, tests/759```760761**Input:** `spec/` (audit-clean), optionally `audits/SECURITY-AUDIT-BASELINE.md`, optionally `ux/` (enriches E2E scenarios)762**Output:** `test/TEST-PLAN.md`, `test/TEST-MATRIX-UC-*.md`, `test/PERF-SCENARIOS.md`, `test/E2E-SCENARIOS.md`763**Next step:** Run `sdd-plan-architect` which reads test strategy for FASE planning764765## Persist Summary766767After generating all output artifacts, update `pipeline-state.json`:7687691. Read `pipeline-state.json` from project root (create if absent with default stage structure)7702. Set `stages["test-planner"].status` = `"done"`7713. Set `stages["test-planner"].lastRun` = current ISO-86017724. Set `stages["test-planner"].summary`:773 - `artifacts`: list of files created in `test/` with labels (e.g., `{"file": "test/TEST-PLAN.md", "label": "Test Strategy"}`)774 - `metrics`: `{ "bdd_scenarios": N, "test_matrices": N, "perf_scenarios": N, "e2e_scenarios": N, "e2e_fields_total": N, "e2e_fields_complete": N, "e2e_field_coverage_pct": N, "invariants_mapped": N, "test_gaps": N }`775 - `highlights`: top 3-5 notable observations (e.g., "101 BDD scenarios cover 85% of requirements", "3 gaps in NFR testing")776 - `nextStep`: `"Run /sdd-plan-architect"`777 - `generatedAt`: current ISO-86017785. Write updated `pipeline-state.json`7796. Display summary table to user (console output)780781## Output Language782783Respond in the same language the user uses. If the user writes in Spanish, respond in Spanish. If in English, respond in English.784785---786> Source: [noelserdna/claude-plugin-sdd](https://github.com/noelserdna/claude-plugin-sdd) — distributed by [TomeVault](https://tomevault.io).787<!-- tomevault:4.0:skill_md:2026-06-24 -->