bmad-method 5.0.0-beta.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +3 -3
- package/.github/ISSUE_TEMPLATE/feature_request.md +3 -3
- package/.github/workflows/discord.yaml +11 -2
- package/.github/workflows/format-check.yaml +42 -0
- package/.github/workflows/manual-release.yaml +173 -0
- package/.husky/pre-commit +3 -0
- package/.vscode/settings.json +26 -1
- package/CHANGELOG.md +0 -11
- package/README.md +2 -0
- package/bmad-core/agent-teams/team-all.yaml +1 -1
- package/bmad-core/agents/bmad-orchestrator.md +1 -1
- package/bmad-core/agents/dev.md +4 -4
- package/bmad-core/data/bmad-kb.md +1 -1
- package/bmad-core/data/test-levels-framework.md +12 -12
- package/bmad-core/tasks/facilitate-brainstorming-session.md +1 -1
- package/bmad-core/tasks/nfr-assess.md +10 -10
- package/bmad-core/tasks/qa-gate.md +23 -23
- package/bmad-core/tasks/review-story.md +18 -18
- package/bmad-core/tasks/risk-profile.md +25 -25
- package/bmad-core/tasks/test-design.md +9 -9
- package/bmad-core/tasks/trace-requirements.md +21 -21
- package/bmad-core/templates/architecture-tmpl.yaml +49 -49
- package/bmad-core/templates/brainstorming-output-tmpl.yaml +5 -5
- package/bmad-core/templates/brownfield-architecture-tmpl.yaml +31 -31
- package/bmad-core/templates/brownfield-prd-tmpl.yaml +13 -13
- package/bmad-core/templates/competitor-analysis-tmpl.yaml +19 -6
- package/bmad-core/templates/front-end-architecture-tmpl.yaml +21 -9
- package/bmad-core/templates/front-end-spec-tmpl.yaml +24 -24
- package/bmad-core/templates/fullstack-architecture-tmpl.yaml +122 -104
- package/bmad-core/templates/market-research-tmpl.yaml +2 -2
- package/bmad-core/templates/prd-tmpl.yaml +9 -9
- package/bmad-core/templates/project-brief-tmpl.yaml +4 -4
- package/bmad-core/templates/qa-gate-tmpl.yaml +9 -9
- package/bmad-core/templates/story-tmpl.yaml +12 -12
- package/bmad-core/workflows/brownfield-fullstack.yaml +9 -9
- package/bmad-core/workflows/brownfield-service.yaml +1 -1
- package/bmad-core/workflows/brownfield-ui.yaml +1 -1
- package/bmad-core/workflows/greenfield-fullstack.yaml +1 -1
- package/bmad-core/workflows/greenfield-service.yaml +1 -1
- package/bmad-core/workflows/greenfield-ui.yaml +1 -1
- package/common/utils/bmad-doc-template.md +5 -5
- package/dist/agents/analyst.txt +28 -15
- package/dist/agents/architect.txt +220 -190
- package/dist/agents/bmad-master.txt +298 -255
- package/dist/agents/bmad-orchestrator.txt +1 -1
- package/dist/agents/pm.txt +20 -20
- package/dist/agents/po.txt +11 -11
- package/dist/agents/qa.txt +275 -618
- package/dist/agents/sm.txt +11 -11
- package/dist/agents/ux-expert.txt +23 -23
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +109 -109
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +75 -77
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +41 -41
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +483 -474
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +1 -1
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +149 -149
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt +20 -20
- package/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +371 -358
- package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +25 -25
- package/dist/teams/team-all.txt +581 -881
- package/dist/teams/team-fullstack.txt +316 -273
- package/dist/teams/team-ide-minimal.txt +276 -619
- package/dist/teams/team-no-ui.txt +281 -238
- package/docs/versioning-and-releases.md +114 -44
- package/eslint.config.mjs +119 -0
- package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.4 Deployment Configuration/1.4.2 - cloudbuild.yaml +26 -26
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +4 -4
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +1 -1
- package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +26 -28
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +50 -50
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +23 -23
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +24 -24
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +42 -42
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +65 -65
- package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +5 -5
- package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +1 -1
- package/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md +3 -3
- package/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +1 -1
- package/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml +23 -23
- package/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml +63 -63
- package/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml +20 -20
- package/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml +65 -65
- package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml +5 -5
- package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml +1 -1
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +20 -20
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +7 -7
- package/package.json +62 -39
- package/prettier.config.mjs +32 -0
- package/release_notes.md +30 -0
- package/tools/bmad-npx-wrapper.js +10 -10
- package/tools/builders/web-builder.js +124 -130
- package/tools/bump-all-versions.js +42 -33
- package/tools/bump-expansion-version.js +23 -16
- package/tools/cli.js +10 -12
- package/tools/flattener/aggregate.js +10 -10
- package/tools/flattener/binary.js +44 -17
- package/tools/flattener/discovery.js +19 -18
- package/tools/flattener/files.js +6 -6
- package/tools/flattener/ignoreRules.js +125 -125
- package/tools/flattener/main.js +201 -304
- package/tools/flattener/projectRoot.js +75 -73
- package/tools/flattener/prompts.js +9 -9
- package/tools/flattener/stats.helpers.js +131 -67
- package/tools/flattener/stats.js +3 -3
- package/tools/flattener/test-matrix.js +201 -193
- package/tools/flattener/xml.js +33 -31
- package/tools/installer/bin/bmad.js +130 -89
- package/tools/installer/config/ide-agent-config.yaml +1 -1
- package/tools/installer/config/install.config.yaml +2 -2
- package/tools/installer/lib/config-loader.js +46 -42
- package/tools/installer/lib/file-manager.js +91 -113
- package/tools/installer/lib/ide-base-setup.js +57 -56
- package/tools/installer/lib/ide-setup.js +375 -343
- package/tools/installer/lib/installer.js +875 -714
- package/tools/installer/lib/memory-profiler.js +54 -53
- package/tools/installer/lib/module-manager.js +19 -15
- package/tools/installer/lib/resource-locator.js +26 -28
- package/tools/installer/package.json +19 -19
- package/tools/lib/dependency-resolver.js +26 -30
- package/tools/lib/yaml-utils.js +7 -7
- package/tools/preview-release-notes.js +66 -0
- package/tools/shared/bannerArt.js +3 -3
- package/tools/sync-installer-version.js +7 -9
- package/tools/update-expansion-version.js +14 -15
- package/tools/upgraders/v3-to-v4-upgrader.js +203 -294
- package/tools/version-bump.js +41 -26
- package/tools/yaml-format.js +56 -43
- package/.github/workflows/promote-to-stable.yml +0 -144
- package/.github/workflows/release.yaml +0 -60
- package/.releaserc.json +0 -21
- package/tools/semantic-release-sync-installer.js +0 -30
|
@@ -1014,7 +1014,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing
|
|
|
1014
1014
|
|
|
1015
1015
|
- **Claude Code**: `/agent-name` (e.g., `/bmad-master`)
|
|
1016
1016
|
- **Cursor**: `@agent-name` (e.g., `@bmad-master`)
|
|
1017
|
-
- **Windsurf**:
|
|
1017
|
+
- **Windsurf**: `/agent-name` (e.g., `/bmad-master`)
|
|
1018
1018
|
- **Trae**: `@agent-name` (e.g., `@bmad-master`)
|
|
1019
1019
|
- **Roo Code**: Select mode from mode selector (e.g., `bmad-master`)
|
|
1020
1020
|
- **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector.
|
|
@@ -2253,7 +2253,7 @@ workflow:
|
|
|
2253
2253
|
elicitation: advanced-elicitation
|
|
2254
2254
|
|
|
2255
2255
|
agent_config:
|
|
2256
|
-
editable_sections:
|
|
2256
|
+
editable_sections:
|
|
2257
2257
|
- Status
|
|
2258
2258
|
- Story
|
|
2259
2259
|
- Acceptance Criteria
|
|
@@ -2270,7 +2270,7 @@ sections:
|
|
|
2270
2270
|
instruction: Select the current status of the story
|
|
2271
2271
|
owner: scrum-master
|
|
2272
2272
|
editors: [scrum-master, dev-agent]
|
|
2273
|
-
|
|
2273
|
+
|
|
2274
2274
|
- id: story
|
|
2275
2275
|
title: Story
|
|
2276
2276
|
type: template-text
|
|
@@ -2282,7 +2282,7 @@ sections:
|
|
|
2282
2282
|
elicit: true
|
|
2283
2283
|
owner: scrum-master
|
|
2284
2284
|
editors: [scrum-master]
|
|
2285
|
-
|
|
2285
|
+
|
|
2286
2286
|
- id: acceptance-criteria
|
|
2287
2287
|
title: Acceptance Criteria
|
|
2288
2288
|
type: numbered-list
|
|
@@ -2290,7 +2290,7 @@ sections:
|
|
|
2290
2290
|
elicit: true
|
|
2291
2291
|
owner: scrum-master
|
|
2292
2292
|
editors: [scrum-master]
|
|
2293
|
-
|
|
2293
|
+
|
|
2294
2294
|
- id: tasks-subtasks
|
|
2295
2295
|
title: Tasks / Subtasks
|
|
2296
2296
|
type: bullet-list
|
|
@@ -2307,7 +2307,7 @@ sections:
|
|
|
2307
2307
|
elicit: true
|
|
2308
2308
|
owner: scrum-master
|
|
2309
2309
|
editors: [scrum-master, dev-agent]
|
|
2310
|
-
|
|
2310
|
+
|
|
2311
2311
|
- id: dev-notes
|
|
2312
2312
|
title: Dev Notes
|
|
2313
2313
|
instruction: |
|
|
@@ -2331,7 +2331,7 @@ sections:
|
|
|
2331
2331
|
elicit: true
|
|
2332
2332
|
owner: scrum-master
|
|
2333
2333
|
editors: [scrum-master]
|
|
2334
|
-
|
|
2334
|
+
|
|
2335
2335
|
- id: change-log
|
|
2336
2336
|
title: Change Log
|
|
2337
2337
|
type: table
|
|
@@ -2339,7 +2339,7 @@ sections:
|
|
|
2339
2339
|
instruction: Track changes made to this story document
|
|
2340
2340
|
owner: scrum-master
|
|
2341
2341
|
editors: [scrum-master, dev-agent, qa-agent]
|
|
2342
|
-
|
|
2342
|
+
|
|
2343
2343
|
- id: dev-agent-record
|
|
2344
2344
|
title: Dev Agent Record
|
|
2345
2345
|
instruction: This section is populated by the development agent during implementation
|
|
@@ -2352,25 +2352,25 @@ sections:
|
|
|
2352
2352
|
instruction: Record the specific AI agent model and version used for development
|
|
2353
2353
|
owner: dev-agent
|
|
2354
2354
|
editors: [dev-agent]
|
|
2355
|
-
|
|
2355
|
+
|
|
2356
2356
|
- id: debug-log-references
|
|
2357
2357
|
title: Debug Log References
|
|
2358
2358
|
instruction: Reference any debug logs or traces generated during development
|
|
2359
2359
|
owner: dev-agent
|
|
2360
2360
|
editors: [dev-agent]
|
|
2361
|
-
|
|
2361
|
+
|
|
2362
2362
|
- id: completion-notes
|
|
2363
2363
|
title: Completion Notes List
|
|
2364
2364
|
instruction: Notes about the completion of tasks and any issues encountered
|
|
2365
2365
|
owner: dev-agent
|
|
2366
2366
|
editors: [dev-agent]
|
|
2367
|
-
|
|
2367
|
+
|
|
2368
2368
|
- id: file-list
|
|
2369
2369
|
title: File List
|
|
2370
2370
|
instruction: List all files created, modified, or affected during story implementation
|
|
2371
2371
|
owner: dev-agent
|
|
2372
2372
|
editors: [dev-agent]
|
|
2373
|
-
|
|
2373
|
+
|
|
2374
2374
|
- id: qa-results
|
|
2375
2375
|
title: QA Results
|
|
2376
2376
|
instruction: Results from QA Agent QA review of the completed story implementation
|
|
@@ -3375,10 +3375,10 @@ Perform a comprehensive test architecture review with quality gate decision. Thi
|
|
|
3375
3375
|
|
|
3376
3376
|
```yaml
|
|
3377
3377
|
required:
|
|
3378
|
-
- story_id:
|
|
3379
|
-
- story_path:
|
|
3380
|
-
- story_title:
|
|
3381
|
-
- story_slug:
|
|
3378
|
+
- story_id: '{epic}.{story}' # e.g., "1.3"
|
|
3379
|
+
- story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml
|
|
3380
|
+
- story_title: '{title}' # If missing, derive from story file H1
|
|
3381
|
+
- story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated)
|
|
3382
3382
|
```
|
|
3383
3383
|
|
|
3384
3384
|
## Prerequisites
|
|
@@ -3540,6 +3540,8 @@ Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml
|
|
|
3540
3540
|
Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
|
|
3541
3541
|
NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
|
|
3542
3542
|
|
|
3543
|
+
# Note: Paths should reference core-config.yaml for custom configurations
|
|
3544
|
+
|
|
3543
3545
|
### Recommended Status
|
|
3544
3546
|
|
|
3545
3547
|
[✓ Ready for Done] / [✗ Changes Required - See unchecked items above]
|
|
@@ -3551,26 +3553,26 @@ NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
|
|
|
3551
3553
|
**Template and Directory:**
|
|
3552
3554
|
|
|
3553
3555
|
- Render from `templates/qa-gate-tmpl.yaml`
|
|
3554
|
-
- Create `docs/qa/gates/` directory if missing
|
|
3556
|
+
- Create `docs/qa/gates/` directory if missing (or configure in core-config.yaml)
|
|
3555
3557
|
- Save to: `docs/qa/gates/{epic}.{story}-{slug}.yml`
|
|
3556
3558
|
|
|
3557
3559
|
Gate file structure:
|
|
3558
3560
|
|
|
3559
3561
|
```yaml
|
|
3560
3562
|
schema: 1
|
|
3561
|
-
story:
|
|
3562
|
-
story_title:
|
|
3563
|
+
story: '{epic}.{story}'
|
|
3564
|
+
story_title: '{story title}'
|
|
3563
3565
|
gate: PASS|CONCERNS|FAIL|WAIVED
|
|
3564
|
-
status_reason:
|
|
3565
|
-
reviewer:
|
|
3566
|
-
updated:
|
|
3566
|
+
status_reason: '1-2 sentence explanation of gate decision'
|
|
3567
|
+
reviewer: 'Quinn (Test Architect)'
|
|
3568
|
+
updated: '{ISO-8601 timestamp}'
|
|
3567
3569
|
|
|
3568
3570
|
top_issues: [] # Empty if no issues
|
|
3569
3571
|
waiver: { active: false } # Set active: true only if WAIVED
|
|
3570
3572
|
|
|
3571
3573
|
# Extended fields (optional but recommended):
|
|
3572
3574
|
quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights
|
|
3573
|
-
expires:
|
|
3575
|
+
expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review
|
|
3574
3576
|
|
|
3575
3577
|
evidence:
|
|
3576
3578
|
tests_reviewed: { count }
|
|
@@ -3582,24 +3584,24 @@ evidence:
|
|
|
3582
3584
|
nfr_validation:
|
|
3583
3585
|
security:
|
|
3584
3586
|
status: PASS|CONCERNS|FAIL
|
|
3585
|
-
notes:
|
|
3587
|
+
notes: 'Specific findings'
|
|
3586
3588
|
performance:
|
|
3587
3589
|
status: PASS|CONCERNS|FAIL
|
|
3588
|
-
notes:
|
|
3590
|
+
notes: 'Specific findings'
|
|
3589
3591
|
reliability:
|
|
3590
3592
|
status: PASS|CONCERNS|FAIL
|
|
3591
|
-
notes:
|
|
3593
|
+
notes: 'Specific findings'
|
|
3592
3594
|
maintainability:
|
|
3593
3595
|
status: PASS|CONCERNS|FAIL
|
|
3594
|
-
notes:
|
|
3596
|
+
notes: 'Specific findings'
|
|
3595
3597
|
|
|
3596
3598
|
recommendations:
|
|
3597
3599
|
immediate: # Must fix before production
|
|
3598
|
-
- action:
|
|
3599
|
-
refs: [
|
|
3600
|
+
- action: 'Add rate limiting'
|
|
3601
|
+
refs: ['api/auth/login.ts']
|
|
3600
3602
|
future: # Can be addressed later
|
|
3601
|
-
- action:
|
|
3602
|
-
refs: [
|
|
3603
|
+
- action: 'Consider caching'
|
|
3604
|
+
refs: ['services/data.ts']
|
|
3603
3605
|
```
|
|
3604
3606
|
|
|
3605
3607
|
### Gate Decision Criteria
|
|
@@ -3711,11 +3713,11 @@ Slug rules:
|
|
|
3711
3713
|
|
|
3712
3714
|
```yaml
|
|
3713
3715
|
schema: 1
|
|
3714
|
-
story:
|
|
3716
|
+
story: '{epic}.{story}'
|
|
3715
3717
|
gate: PASS|CONCERNS|FAIL|WAIVED
|
|
3716
|
-
status_reason:
|
|
3717
|
-
reviewer:
|
|
3718
|
-
updated:
|
|
3718
|
+
status_reason: '1-2 sentence explanation of gate decision'
|
|
3719
|
+
reviewer: 'Quinn'
|
|
3720
|
+
updated: '{ISO-8601 timestamp}'
|
|
3719
3721
|
top_issues: [] # Empty array if no issues
|
|
3720
3722
|
waiver: { active: false } # Only set active: true if WAIVED
|
|
3721
3723
|
```
|
|
@@ -3724,20 +3726,20 @@ waiver: { active: false } # Only set active: true if WAIVED
|
|
|
3724
3726
|
|
|
3725
3727
|
```yaml
|
|
3726
3728
|
schema: 1
|
|
3727
|
-
story:
|
|
3729
|
+
story: '1.3'
|
|
3728
3730
|
gate: CONCERNS
|
|
3729
|
-
status_reason:
|
|
3730
|
-
reviewer:
|
|
3731
|
-
updated:
|
|
3731
|
+
status_reason: 'Missing rate limiting on auth endpoints poses security risk.'
|
|
3732
|
+
reviewer: 'Quinn'
|
|
3733
|
+
updated: '2025-01-12T10:15:00Z'
|
|
3732
3734
|
top_issues:
|
|
3733
|
-
- id:
|
|
3735
|
+
- id: 'SEC-001'
|
|
3734
3736
|
severity: high # ONLY: low|medium|high
|
|
3735
|
-
finding:
|
|
3736
|
-
suggested_action:
|
|
3737
|
-
- id:
|
|
3737
|
+
finding: 'No rate limiting on login endpoint'
|
|
3738
|
+
suggested_action: 'Add rate limiting middleware before production'
|
|
3739
|
+
- id: 'TEST-001'
|
|
3738
3740
|
severity: medium
|
|
3739
|
-
finding:
|
|
3740
|
-
suggested_action:
|
|
3741
|
+
finding: 'No integration tests for auth flow'
|
|
3742
|
+
suggested_action: 'Add integration test coverage'
|
|
3741
3743
|
waiver: { active: false }
|
|
3742
3744
|
```
|
|
3743
3745
|
|
|
@@ -3745,20 +3747,20 @@ waiver: { active: false }
|
|
|
3745
3747
|
|
|
3746
3748
|
```yaml
|
|
3747
3749
|
schema: 1
|
|
3748
|
-
story:
|
|
3750
|
+
story: '1.3'
|
|
3749
3751
|
gate: WAIVED
|
|
3750
|
-
status_reason:
|
|
3751
|
-
reviewer:
|
|
3752
|
-
updated:
|
|
3752
|
+
status_reason: 'Known issues accepted for MVP release.'
|
|
3753
|
+
reviewer: 'Quinn'
|
|
3754
|
+
updated: '2025-01-12T10:15:00Z'
|
|
3753
3755
|
top_issues:
|
|
3754
|
-
- id:
|
|
3756
|
+
- id: 'PERF-001'
|
|
3755
3757
|
severity: low
|
|
3756
|
-
finding:
|
|
3757
|
-
suggested_action:
|
|
3758
|
+
finding: 'Dashboard loads slowly with 1000+ items'
|
|
3759
|
+
suggested_action: 'Implement pagination in next sprint'
|
|
3758
3760
|
waiver:
|
|
3759
3761
|
active: true
|
|
3760
|
-
reason:
|
|
3761
|
-
approved_by:
|
|
3762
|
+
reason: 'MVP release - performance optimization deferred'
|
|
3763
|
+
approved_by: 'Product Owner'
|
|
3762
3764
|
```
|
|
3763
3765
|
|
|
3764
3766
|
## Gate Decision Criteria
|
|
@@ -3877,21 +3879,21 @@ Identify all testable requirements from:
|
|
|
3877
3879
|
For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written):
|
|
3878
3880
|
|
|
3879
3881
|
```yaml
|
|
3880
|
-
requirement:
|
|
3882
|
+
requirement: 'AC1: User can login with valid credentials'
|
|
3881
3883
|
test_mappings:
|
|
3882
|
-
- test_file:
|
|
3883
|
-
test_case:
|
|
3884
|
+
- test_file: 'auth/login.test.ts'
|
|
3885
|
+
test_case: 'should successfully login with valid email and password'
|
|
3884
3886
|
# Given-When-Then describes WHAT the test validates, not HOW it's coded
|
|
3885
|
-
given:
|
|
3886
|
-
when:
|
|
3887
|
-
then:
|
|
3887
|
+
given: 'A registered user with valid credentials'
|
|
3888
|
+
when: 'They submit the login form'
|
|
3889
|
+
then: 'They are redirected to dashboard and session is created'
|
|
3888
3890
|
coverage: full
|
|
3889
3891
|
|
|
3890
|
-
- test_file:
|
|
3891
|
-
test_case:
|
|
3892
|
-
given:
|
|
3893
|
-
when:
|
|
3894
|
-
then:
|
|
3892
|
+
- test_file: 'e2e/auth-flow.test.ts'
|
|
3893
|
+
test_case: 'complete login flow'
|
|
3894
|
+
given: 'User on login page'
|
|
3895
|
+
when: 'Entering valid credentials and submitting'
|
|
3896
|
+
then: 'Dashboard loads with user data'
|
|
3895
3897
|
coverage: integration
|
|
3896
3898
|
```
|
|
3897
3899
|
|
|
@@ -3913,19 +3915,19 @@ Document any gaps found:
|
|
|
3913
3915
|
|
|
3914
3916
|
```yaml
|
|
3915
3917
|
coverage_gaps:
|
|
3916
|
-
- requirement:
|
|
3917
|
-
gap:
|
|
3918
|
+
- requirement: 'AC3: Password reset email sent within 60 seconds'
|
|
3919
|
+
gap: 'No test for email delivery timing'
|
|
3918
3920
|
severity: medium
|
|
3919
3921
|
suggested_test:
|
|
3920
3922
|
type: integration
|
|
3921
|
-
description:
|
|
3923
|
+
description: 'Test email service SLA compliance'
|
|
3922
3924
|
|
|
3923
|
-
- requirement:
|
|
3924
|
-
gap:
|
|
3925
|
+
- requirement: 'AC5: Support 1000 concurrent users'
|
|
3926
|
+
gap: 'No load testing implemented'
|
|
3925
3927
|
severity: high
|
|
3926
3928
|
suggested_test:
|
|
3927
3929
|
type: performance
|
|
3928
|
-
description:
|
|
3930
|
+
description: 'Load test with 1000 concurrent connections'
|
|
3929
3931
|
```
|
|
3930
3932
|
|
|
3931
3933
|
## Outputs
|
|
@@ -3941,11 +3943,11 @@ trace:
|
|
|
3941
3943
|
full: Y
|
|
3942
3944
|
partial: Z
|
|
3943
3945
|
none: W
|
|
3944
|
-
planning_ref:
|
|
3946
|
+
planning_ref: 'docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md'
|
|
3945
3947
|
uncovered:
|
|
3946
|
-
- ac:
|
|
3947
|
-
reason:
|
|
3948
|
-
notes:
|
|
3948
|
+
- ac: 'AC3'
|
|
3949
|
+
reason: 'No test found for password reset timing'
|
|
3950
|
+
notes: 'See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md'
|
|
3949
3951
|
```
|
|
3950
3952
|
|
|
3951
3953
|
### Output 2: Traceability Report
|
|
@@ -4119,10 +4121,10 @@ Generate a comprehensive risk assessment matrix for a story implementation using
|
|
|
4119
4121
|
|
|
4120
4122
|
```yaml
|
|
4121
4123
|
required:
|
|
4122
|
-
- story_id:
|
|
4123
|
-
- story_path:
|
|
4124
|
-
- story_title:
|
|
4125
|
-
- story_slug:
|
|
4124
|
+
- story_id: '{epic}.{story}' # e.g., "1.3"
|
|
4125
|
+
- story_path: 'docs/stories/{epic}.{story}.*.md'
|
|
4126
|
+
- story_title: '{title}' # If missing, derive from story file H1
|
|
4127
|
+
- story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated)
|
|
4126
4128
|
```
|
|
4127
4129
|
|
|
4128
4130
|
## Purpose
|
|
@@ -4192,14 +4194,14 @@ For each category, identify specific risks:
|
|
|
4192
4194
|
|
|
4193
4195
|
```yaml
|
|
4194
4196
|
risk:
|
|
4195
|
-
id:
|
|
4197
|
+
id: 'SEC-001' # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH
|
|
4196
4198
|
category: security
|
|
4197
|
-
title:
|
|
4198
|
-
description:
|
|
4199
|
+
title: 'Insufficient input validation on user forms'
|
|
4200
|
+
description: 'Form inputs not properly sanitized could lead to XSS attacks'
|
|
4199
4201
|
affected_components:
|
|
4200
|
-
-
|
|
4201
|
-
-
|
|
4202
|
-
detection_method:
|
|
4202
|
+
- 'UserRegistrationForm'
|
|
4203
|
+
- 'ProfileUpdateForm'
|
|
4204
|
+
detection_method: 'Code review revealed missing validation'
|
|
4203
4205
|
```
|
|
4204
4206
|
|
|
4205
4207
|
### 2. Risk Assessment
|
|
@@ -4246,20 +4248,20 @@ For each identified risk, provide mitigation:
|
|
|
4246
4248
|
|
|
4247
4249
|
```yaml
|
|
4248
4250
|
mitigation:
|
|
4249
|
-
risk_id:
|
|
4250
|
-
strategy:
|
|
4251
|
+
risk_id: 'SEC-001'
|
|
4252
|
+
strategy: 'preventive' # preventive|detective|corrective
|
|
4251
4253
|
actions:
|
|
4252
|
-
-
|
|
4253
|
-
-
|
|
4254
|
-
-
|
|
4255
|
-
-
|
|
4254
|
+
- 'Implement input validation library (e.g., validator.js)'
|
|
4255
|
+
- 'Add CSP headers to prevent XSS execution'
|
|
4256
|
+
- 'Sanitize all user inputs before storage'
|
|
4257
|
+
- 'Escape all outputs in templates'
|
|
4256
4258
|
testing_requirements:
|
|
4257
|
-
-
|
|
4258
|
-
-
|
|
4259
|
-
-
|
|
4260
|
-
residual_risk:
|
|
4261
|
-
owner:
|
|
4262
|
-
timeline:
|
|
4259
|
+
- 'Security testing with OWASP ZAP'
|
|
4260
|
+
- 'Manual penetration testing of forms'
|
|
4261
|
+
- 'Unit tests for validation functions'
|
|
4262
|
+
residual_risk: 'Low - Some zero-day vulnerabilities may remain'
|
|
4263
|
+
owner: 'dev'
|
|
4264
|
+
timeline: 'Before deployment'
|
|
4263
4265
|
```
|
|
4264
4266
|
|
|
4265
4267
|
## Outputs
|
|
@@ -4285,12 +4287,12 @@ risk_summary:
|
|
|
4285
4287
|
highest:
|
|
4286
4288
|
id: SEC-001
|
|
4287
4289
|
score: 9
|
|
4288
|
-
title:
|
|
4290
|
+
title: 'XSS on profile form'
|
|
4289
4291
|
recommendations:
|
|
4290
4292
|
must_fix:
|
|
4291
|
-
-
|
|
4293
|
+
- 'Add input sanitization & CSP'
|
|
4292
4294
|
monitor:
|
|
4293
|
-
-
|
|
4295
|
+
- 'Add security alerts for auth endpoints'
|
|
4294
4296
|
```
|
|
4295
4297
|
|
|
4296
4298
|
### Output 2: Markdown Report
|
|
@@ -4475,299 +4477,79 @@ Create comprehensive test scenarios with appropriate test level recommendations
|
|
|
4475
4477
|
|
|
4476
4478
|
```yaml
|
|
4477
4479
|
required:
|
|
4478
|
-
- story_id:
|
|
4479
|
-
- story_path:
|
|
4480
|
-
- story_title:
|
|
4481
|
-
- story_slug:
|
|
4480
|
+
- story_id: '{epic}.{story}' # e.g., "1.3"
|
|
4481
|
+
- story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml
|
|
4482
|
+
- story_title: '{title}' # If missing, derive from story file H1
|
|
4483
|
+
- story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated)
|
|
4482
4484
|
```
|
|
4483
4485
|
|
|
4484
4486
|
## Purpose
|
|
4485
4487
|
|
|
4486
4488
|
Design a complete test strategy that identifies what to test, at which level (unit/integration/e2e), and why. This ensures efficient test coverage without redundancy while maintaining appropriate test boundaries.
|
|
4487
4489
|
|
|
4488
|
-
##
|
|
4489
|
-
|
|
4490
|
-
### Unit Tests
|
|
4491
|
-
|
|
4492
|
-
**When to use:**
|
|
4493
|
-
|
|
4494
|
-
- Testing pure functions and business logic
|
|
4495
|
-
- Algorithm correctness
|
|
4496
|
-
- Input validation and data transformation
|
|
4497
|
-
- Error handling in isolated components
|
|
4498
|
-
- Complex calculations or state machines
|
|
4499
|
-
|
|
4500
|
-
**Characteristics:**
|
|
4501
|
-
|
|
4502
|
-
- Fast execution (immediate feedback)
|
|
4503
|
-
- No external dependencies (DB, API, file system)
|
|
4504
|
-
- Highly maintainable and stable
|
|
4505
|
-
- Easy to debug failures
|
|
4506
|
-
|
|
4507
|
-
**Example scenarios:**
|
|
4508
|
-
|
|
4509
|
-
```yaml
|
|
4510
|
-
unit_test:
|
|
4511
|
-
component: "PriceCalculator"
|
|
4512
|
-
scenario: "Calculate discount with multiple rules"
|
|
4513
|
-
justification: "Complex business logic with multiple branches"
|
|
4514
|
-
mock_requirements: "None - pure function"
|
|
4515
|
-
```
|
|
4516
|
-
|
|
4517
|
-
### Integration Tests
|
|
4518
|
-
|
|
4519
|
-
**When to use:**
|
|
4520
|
-
|
|
4521
|
-
- Testing component interactions
|
|
4522
|
-
- Database operations and queries
|
|
4523
|
-
- API endpoint behavior
|
|
4524
|
-
- Service layer orchestration
|
|
4525
|
-
- External service integration (with test doubles)
|
|
4526
|
-
|
|
4527
|
-
**Characteristics:**
|
|
4528
|
-
|
|
4529
|
-
- Moderate execution time
|
|
4530
|
-
- May use test databases or containers
|
|
4531
|
-
- Tests multiple components together
|
|
4532
|
-
- Validates contracts between components
|
|
4533
|
-
|
|
4534
|
-
**Example scenarios:**
|
|
4490
|
+
## Dependencies
|
|
4535
4491
|
|
|
4536
4492
|
```yaml
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
justification: "Tests transaction boundaries and constraint handling"
|
|
4541
|
-
test_doubles: "Mock email service, real test database"
|
|
4493
|
+
data:
|
|
4494
|
+
- test-levels-framework.md # Unit/Integration/E2E decision criteria
|
|
4495
|
+
- test-priorities-matrix.md # P0/P1/P2/P3 classification system
|
|
4542
4496
|
```
|
|
4543
4497
|
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
**When to use:**
|
|
4547
|
-
|
|
4548
|
-
- Critical user journeys
|
|
4549
|
-
- Cross-system workflows
|
|
4550
|
-
- UI interaction flows
|
|
4551
|
-
- Full stack validation
|
|
4552
|
-
- Production-like scenario testing
|
|
4553
|
-
|
|
4554
|
-
**Characteristics:**
|
|
4555
|
-
|
|
4556
|
-
- Keep under 90 seconds per test
|
|
4557
|
-
- Tests complete user scenarios
|
|
4558
|
-
- Uses real or production-like environment
|
|
4559
|
-
- Higher maintenance cost
|
|
4560
|
-
- More prone to flakiness
|
|
4561
|
-
|
|
4562
|
-
**Example scenarios:**
|
|
4563
|
-
|
|
4564
|
-
```yaml
|
|
4565
|
-
e2e_test:
|
|
4566
|
-
flow: "Complete purchase flow"
|
|
4567
|
-
scenario: "User browses, adds to cart, and completes checkout"
|
|
4568
|
-
justification: "Critical business flow requiring full stack validation"
|
|
4569
|
-
environment: "Staging with test payment gateway"
|
|
4570
|
-
```
|
|
4571
|
-
|
|
4572
|
-
## Test Design Process
|
|
4498
|
+
## Process
|
|
4573
4499
|
|
|
4574
4500
|
### 1. Analyze Story Requirements
|
|
4575
4501
|
|
|
4576
|
-
Break down each acceptance criterion into testable scenarios:
|
|
4577
|
-
|
|
4578
|
-
```yaml
|
|
4579
|
-
acceptance_criterion: "User can reset password via email"
|
|
4580
|
-
test_scenarios:
|
|
4581
|
-
- level: unit
|
|
4582
|
-
what: "Password validation rules"
|
|
4583
|
-
why: "Complex regex and business rules"
|
|
4584
|
-
|
|
4585
|
-
- level: integration
|
|
4586
|
-
what: "Password reset token generation and storage"
|
|
4587
|
-
why: "Database interaction with expiry logic"
|
|
4588
|
-
|
|
4589
|
-
- level: integration
|
|
4590
|
-
what: "Email service integration"
|
|
4591
|
-
why: "External service with retry logic"
|
|
4592
|
-
|
|
4593
|
-
- level: e2e
|
|
4594
|
-
what: "Complete password reset flow"
|
|
4595
|
-
why: "Critical security flow needing full validation"
|
|
4596
|
-
```
|
|
4597
|
-
|
|
4598
|
-
### 2. Apply Test Level Heuristics
|
|
4599
|
-
|
|
4600
|
-
Use these rules to determine appropriate test levels:
|
|
4601
|
-
|
|
4602
|
-
```markdown
|
|
4603
|
-
## Test Level Selection Rules
|
|
4604
|
-
|
|
4605
|
-
### Favor Unit Tests When:
|
|
4606
|
-
|
|
4607
|
-
- Logic can be isolated
|
|
4608
|
-
- No side effects involved
|
|
4609
|
-
- Fast feedback needed
|
|
4610
|
-
- High cyclomatic complexity
|
|
4502
|
+
Break down each acceptance criterion into testable scenarios. For each AC:
|
|
4611
4503
|
|
|
4612
|
-
|
|
4504
|
+
- Identify the core functionality to test
|
|
4505
|
+
- Determine data variations needed
|
|
4506
|
+
- Consider error conditions
|
|
4507
|
+
- Note edge cases
|
|
4613
4508
|
|
|
4614
|
-
|
|
4615
|
-
- Validating service contracts
|
|
4616
|
-
- Testing middleware/interceptors
|
|
4617
|
-
- Component boundaries critical
|
|
4509
|
+
### 2. Apply Test Level Framework
|
|
4618
4510
|
|
|
4619
|
-
|
|
4511
|
+
**Reference:** Load `test-levels-framework.md` for detailed criteria
|
|
4620
4512
|
|
|
4621
|
-
|
|
4622
|
-
- Multi-system interactions
|
|
4623
|
-
- Regulatory compliance scenarios
|
|
4624
|
-
- Visual regression important
|
|
4513
|
+
Quick rules:
|
|
4625
4514
|
|
|
4626
|
-
|
|
4515
|
+
- **Unit**: Pure logic, algorithms, calculations
|
|
4516
|
+
- **Integration**: Component interactions, DB operations
|
|
4517
|
+
- **E2E**: Critical user journeys, compliance
|
|
4627
4518
|
|
|
4628
|
-
|
|
4629
|
-
- Unit testing framework behavior
|
|
4630
|
-
- Integration testing third-party libraries
|
|
4631
|
-
- Duplicate coverage across levels
|
|
4519
|
+
### 3. Assign Priorities
|
|
4632
4520
|
|
|
4633
|
-
|
|
4521
|
+
**Reference:** Load `test-priorities-matrix.md` for classification
|
|
4634
4522
|
|
|
4635
|
-
|
|
4523
|
+
Quick priority assignment:
|
|
4636
4524
|
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4525
|
+
- **P0**: Revenue-critical, security, compliance
|
|
4526
|
+
- **P1**: Core user journeys, frequently used
|
|
4527
|
+
- **P2**: Secondary features, admin functions
|
|
4528
|
+
- **P3**: Nice-to-have, rarely used
|
|
4640
4529
|
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
- Testing different aspects (unit: logic, integration: interaction, e2e: user experience)
|
|
4644
|
-
- Critical paths requiring defense in depth
|
|
4645
|
-
- Regression prevention for previously broken functionality
|
|
4646
|
-
```
|
|
4530
|
+
### 4. Design Test Scenarios
|
|
4647
4531
|
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
**Test ID Format:** `{EPIC}.{STORY}-{LEVEL}-{SEQ}`
|
|
4651
|
-
|
|
4652
|
-
- Example: `1.3-UNIT-001`, `1.3-INT-002`, `1.3-E2E-001`
|
|
4653
|
-
- Ensures traceability across all artifacts
|
|
4654
|
-
|
|
4655
|
-
**Naming Convention:**
|
|
4656
|
-
|
|
4657
|
-
- Unit: `test_{component}_{scenario}`
|
|
4658
|
-
- Integration: `test_{flow}_{interaction}`
|
|
4659
|
-
- E2E: `test_{journey}_{outcome}`
|
|
4660
|
-
|
|
4661
|
-
**Risk Linkage:**
|
|
4662
|
-
|
|
4663
|
-
- Tag tests with risk IDs they mitigate
|
|
4664
|
-
- Prioritize tests for high-risk areas (P0)
|
|
4665
|
-
- Link to risk profile when available
|
|
4666
|
-
|
|
4667
|
-
For each identified test need:
|
|
4532
|
+
For each identified test need, create:
|
|
4668
4533
|
|
|
4669
4534
|
```yaml
|
|
4670
4535
|
test_scenario:
|
|
4671
|
-
id:
|
|
4672
|
-
requirement:
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
input: "Timestamp array"
|
|
4679
|
-
expected: "Correct window calculation"
|
|
4680
|
-
|
|
4681
|
-
integration_tests:
|
|
4682
|
-
- name: "Login endpoint enforces rate limit"
|
|
4683
|
-
setup: "5 failed attempts"
|
|
4684
|
-
action: "6th attempt"
|
|
4685
|
-
expected: "429 response with retry-after header"
|
|
4686
|
-
|
|
4687
|
-
e2e_tests:
|
|
4688
|
-
- name: "User sees rate limit message"
|
|
4689
|
-
setup: "Trigger rate limit"
|
|
4690
|
-
validation: "Error message displayed, retry timer shown"
|
|
4536
|
+
id: '{epic}.{story}-{LEVEL}-{SEQ}'
|
|
4537
|
+
requirement: 'AC reference'
|
|
4538
|
+
priority: P0|P1|P2|P3
|
|
4539
|
+
level: unit|integration|e2e
|
|
4540
|
+
description: 'What is being tested'
|
|
4541
|
+
justification: 'Why this level was chosen'
|
|
4542
|
+
mitigates_risks: ['RISK-001'] # If risk profile exists
|
|
4691
4543
|
```
|
|
4692
4544
|
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
**Per Acceptance Criterion:**
|
|
4696
|
-
|
|
4697
|
-
- At least 1 unit test for business logic
|
|
4698
|
-
- At least 1 integration test if multiple components interact
|
|
4699
|
-
- At least 1 E2E test if it's a user-facing feature
|
|
4700
|
-
|
|
4701
|
-
**Exceptions:**
|
|
4702
|
-
|
|
4703
|
-
- Pure UI changes: May skip unit tests
|
|
4704
|
-
- Pure logic changes: May skip E2E tests
|
|
4705
|
-
- Infrastructure changes: May focus on integration tests
|
|
4706
|
-
|
|
4707
|
-
**When in doubt:** Start with unit tests, add integration for interactions, E2E for critical paths only.
|
|
4708
|
-
|
|
4709
|
-
## Test Quality Standards
|
|
4710
|
-
|
|
4711
|
-
### Core Testing Principles
|
|
4712
|
-
|
|
4713
|
-
**No Flaky Tests:** Ensure reliability through proper async handling, explicit waits, and atomic test design.
|
|
4714
|
-
|
|
4715
|
-
**No Hard Waits/Sleeps:** Use dynamic waiting strategies (e.g., polling, event-based triggers).
|
|
4716
|
-
|
|
4717
|
-
**Stateless & Parallel-Safe:** Tests run independently; use cron jobs or semaphores only if unavoidable.
|
|
4718
|
-
|
|
4719
|
-
**No Order Dependency:** Every it/describe/context block works in isolation (supports .only execution).
|
|
4720
|
-
|
|
4721
|
-
**Self-Cleaning Tests:** Test sets up its own data and automatically deletes/deactivates entities created during testing.
|
|
4722
|
-
|
|
4723
|
-
**Tests Live Near Source Code:** Co-locate test files with the code they validate (e.g., `*.spec.js` alongside components).
|
|
4724
|
-
|
|
4725
|
-
### Execution Strategy
|
|
4726
|
-
|
|
4727
|
-
**Shifted Left:**
|
|
4728
|
-
|
|
4729
|
-
- Start with local environments or ephemeral stacks
|
|
4730
|
-
- Validate functionality across all deployment stages (local → dev → stage)
|
|
4731
|
-
|
|
4732
|
-
**Low Maintenance:** Minimize manual upkeep (avoid brittle selectors, do not repeat UI actions, leverage APIs).
|
|
4733
|
-
|
|
4734
|
-
**CI Execution Evidence:** Integrate into pipelines with clear logs/artifacts.
|
|
4735
|
-
|
|
4736
|
-
**Visibility:** Generate test reports (e.g., JUnit XML, HTML) for failures and trends.
|
|
4737
|
-
|
|
4738
|
-
### Coverage Requirements
|
|
4739
|
-
|
|
4740
|
-
**Release Confidence:**
|
|
4545
|
+
### 5. Validate Coverage
|
|
4741
4546
|
|
|
4742
|
-
|
|
4743
|
-
- Edge Cases: Critical error/validation scenarios are covered
|
|
4744
|
-
- Feature Flags: Test both enabled and disabled states where applicable
|
|
4547
|
+
Ensure:
|
|
4745
4548
|
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
**Naming:** Follow conventions (e.g., `describe('Component')`, `it('should do X when Y')`).
|
|
4751
|
-
|
|
4752
|
-
**Size:** Aim for files ≤200 lines; split/chunk large tests logically.
|
|
4753
|
-
|
|
4754
|
-
**Speed:** Target individual tests ≤90 seconds; optimize slow setups (e.g., shared fixtures).
|
|
4755
|
-
|
|
4756
|
-
**Careful Abstractions:** Favor readability over DRY when balancing helper reuse (page objects are okay, assertion logic is not).
|
|
4757
|
-
|
|
4758
|
-
**Test Cleanup:** Ensure tests clean up resources they create (e.g., closing browser, deleting test data).
|
|
4759
|
-
|
|
4760
|
-
**Deterministic Flow:** Tests should refrain from using conditionals (e.g., if/else) to control flow or try/catch blocks where possible.
|
|
4761
|
-
|
|
4762
|
-
### API Testing Standards
|
|
4763
|
-
|
|
4764
|
-
- Tests must not depend on hardcoded data → use factories and per-test setup
|
|
4765
|
-
- Always test both happy path and negative/error cases
|
|
4766
|
-
- API tests should run parallel safely (no global state shared)
|
|
4767
|
-
- Test idempotency where applicable (e.g., duplicate requests)
|
|
4768
|
-
- Tests should clean up their data
|
|
4769
|
-
- Response logs should only be printed in case of failure
|
|
4770
|
-
- Auth tests must validate token expiration and renewal
|
|
4549
|
+
- Every AC has at least one test
|
|
4550
|
+
- No duplicate coverage across levels
|
|
4551
|
+
- Critical paths have multiple levels
|
|
4552
|
+
- Risk mitigations are addressed
|
|
4771
4553
|
|
|
4772
4554
|
## Outputs
|
|
4773
4555
|
|
|
@@ -4775,13 +4557,11 @@ test_scenario:
|
|
|
4775
4557
|
|
|
4776
4558
|
**Save to:** `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md`
|
|
4777
4559
|
|
|
4778
|
-
Generate a comprehensive test design document:
|
|
4779
|
-
|
|
4780
4560
|
```markdown
|
|
4781
4561
|
# Test Design: Story {epic}.{story}
|
|
4782
4562
|
|
|
4783
4563
|
Date: {date}
|
|
4784
|
-
|
|
4564
|
+
Designer: Quinn (Test Architect)
|
|
4785
4565
|
|
|
4786
4566
|
## Test Strategy Overview
|
|
4787
4567
|
|
|
@@ -4789,212 +4569,80 @@ Reviewer: Quinn (Test Architect)
|
|
|
4789
4569
|
- Unit tests: Y (A%)
|
|
4790
4570
|
- Integration tests: Z (B%)
|
|
4791
4571
|
- E2E tests: W (C%)
|
|
4572
|
+
- Priority distribution: P0: X, P1: Y, P2: Z
|
|
4792
4573
|
|
|
4793
|
-
## Test
|
|
4794
|
-
|
|
4795
|
-
[Explain why this distribution was chosen]
|
|
4796
|
-
|
|
4797
|
-
## Detailed Test Scenarios
|
|
4798
|
-
|
|
4799
|
-
### Requirement: AC1 - {description}
|
|
4800
|
-
|
|
4801
|
-
#### Unit Tests (3 scenarios)
|
|
4802
|
-
|
|
4803
|
-
1. **ID**: 1.3-UNIT-001
|
|
4804
|
-
**Test**: Validate input format
|
|
4805
|
-
- **Why Unit**: Pure validation logic
|
|
4806
|
-
- **Coverage**: Input edge cases
|
|
4807
|
-
- **Mocks**: None needed
|
|
4808
|
-
- **Mitigates**: DATA-001 (if applicable)
|
|
4809
|
-
|
|
4810
|
-
#### Integration Tests (2 scenarios)
|
|
4811
|
-
|
|
4812
|
-
1. **ID**: 1.3-INT-001
|
|
4813
|
-
**Test**: Service processes valid request
|
|
4814
|
-
- **Why Integration**: Multiple components involved
|
|
4815
|
-
- **Coverage**: Happy path + error handling
|
|
4816
|
-
- **Test Doubles**: Mock external API
|
|
4817
|
-
- **Mitigates**: TECH-002
|
|
4818
|
-
|
|
4819
|
-
#### E2E Tests (1 scenario)
|
|
4820
|
-
|
|
4821
|
-
1. **ID**: 1.3-E2E-001
|
|
4822
|
-
**Test**: Complete user workflow
|
|
4823
|
-
- **Why E2E**: Critical user journey
|
|
4824
|
-
- **Coverage**: Full stack validation
|
|
4825
|
-
- **Environment**: Staging
|
|
4826
|
-
- **Max Duration**: 90 seconds
|
|
4827
|
-
- **Mitigates**: BUS-001
|
|
4828
|
-
|
|
4829
|
-
[Continue for all requirements...]
|
|
4830
|
-
|
|
4831
|
-
## Test Data Requirements
|
|
4832
|
-
|
|
4833
|
-
### Unit Test Data
|
|
4834
|
-
|
|
4835
|
-
- Static fixtures for calculations
|
|
4836
|
-
- Edge case values arrays
|
|
4837
|
-
|
|
4838
|
-
### Integration Test Data
|
|
4839
|
-
|
|
4840
|
-
- Test database seeds
|
|
4841
|
-
- API response fixtures
|
|
4842
|
-
|
|
4843
|
-
### E2E Test Data
|
|
4844
|
-
|
|
4845
|
-
- Test user accounts
|
|
4846
|
-
- Sandbox environment data
|
|
4847
|
-
|
|
4848
|
-
## Mock/Stub Strategy
|
|
4849
|
-
|
|
4850
|
-
### What to Mock
|
|
4851
|
-
|
|
4852
|
-
- External services (payment, email)
|
|
4853
|
-
- Time-dependent functions
|
|
4854
|
-
- Random number generators
|
|
4855
|
-
|
|
4856
|
-
### What NOT to Mock
|
|
4857
|
-
|
|
4858
|
-
- Core business logic
|
|
4859
|
-
- Database in integration tests
|
|
4860
|
-
- Critical security functions
|
|
4861
|
-
|
|
4862
|
-
## Test Execution Implementation
|
|
4863
|
-
|
|
4864
|
-
### Parallel Execution
|
|
4865
|
-
|
|
4866
|
-
- All unit tests: Fully parallel (stateless requirement)
|
|
4867
|
-
- Integration tests: Parallel with isolated databases
|
|
4868
|
-
- E2E tests: Sequential or limited parallelism
|
|
4869
|
-
|
|
4870
|
-
### Execution Order
|
|
4574
|
+
## Test Scenarios by Acceptance Criteria
|
|
4871
4575
|
|
|
4872
|
-
|
|
4873
|
-
2. Integration tests second
|
|
4874
|
-
3. E2E tests last (expensive, max 90 seconds each)
|
|
4576
|
+
### AC1: {description}
|
|
4875
4577
|
|
|
4876
|
-
|
|
4578
|
+
#### Scenarios
|
|
4877
4579
|
|
|
4878
|
-
|
|
4580
|
+
| ID | Level | Priority | Test | Justification |
|
|
4581
|
+
| ------------ | ----------- | -------- | ------------------------- | ------------------------ |
|
|
4582
|
+
| 1.3-UNIT-001 | Unit | P0 | Validate input format | Pure validation logic |
|
|
4583
|
+
| 1.3-INT-001 | Integration | P0 | Service processes request | Multi-component flow |
|
|
4584
|
+
| 1.3-E2E-001 | E2E | P1 | User completes journey | Critical path validation |
|
|
4879
4585
|
|
|
4880
|
-
|
|
4881
|
-
- Data integrity tests (DATA-\* risks)
|
|
4882
|
-
- Critical business flow tests (BUS-\* risks)
|
|
4883
|
-
- Tests for risks scored ≥6 in risk profile
|
|
4884
|
-
|
|
4885
|
-
### P1 - Should Have (Medium Risks)
|
|
4886
|
-
|
|
4887
|
-
- Edge case coverage
|
|
4888
|
-
- Performance tests (PERF-\* risks)
|
|
4889
|
-
- Error recovery tests
|
|
4890
|
-
- Tests for risks scored 4-5
|
|
4891
|
-
|
|
4892
|
-
### P2 - Nice to Have (Low Risks)
|
|
4893
|
-
|
|
4894
|
-
- UI polish tests
|
|
4895
|
-
- Minor validation tests
|
|
4896
|
-
- Tests for risks scored ≤3
|
|
4897
|
-
|
|
4898
|
-
## Test Maintenance Considerations
|
|
4899
|
-
|
|
4900
|
-
### High Maintenance Tests
|
|
4901
|
-
|
|
4902
|
-
[List tests that may need frequent updates]
|
|
4903
|
-
|
|
4904
|
-
### Stability Measures
|
|
4905
|
-
|
|
4906
|
-
- No retry strategies (tests must be deterministic)
|
|
4907
|
-
- Dynamic waits only (no hard sleeps)
|
|
4908
|
-
- Environment isolation
|
|
4909
|
-
- Self-cleaning test data
|
|
4910
|
-
|
|
4911
|
-
## Coverage Goals
|
|
4912
|
-
|
|
4913
|
-
### Unit Test Coverage
|
|
4914
|
-
|
|
4915
|
-
- Target: 80% line coverage
|
|
4916
|
-
- Focus: Business logic, calculations
|
|
4586
|
+
[Continue for all ACs...]
|
|
4917
4587
|
|
|
4918
|
-
|
|
4588
|
+
## Risk Coverage
|
|
4919
4589
|
|
|
4920
|
-
|
|
4921
|
-
- Focus: Contract validation
|
|
4590
|
+
[Map test scenarios to identified risks if risk profile exists]
|
|
4922
4591
|
|
|
4923
|
-
|
|
4592
|
+
## Recommended Execution Order
|
|
4924
4593
|
|
|
4925
|
-
|
|
4926
|
-
|
|
4594
|
+
1. P0 Unit tests (fail fast)
|
|
4595
|
+
2. P0 Integration tests
|
|
4596
|
+
3. P0 E2E tests
|
|
4597
|
+
4. P1 tests in order
|
|
4598
|
+
5. P2+ as time permits
|
|
4927
4599
|
```
|
|
4928
4600
|
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
### Over-testing Smells
|
|
4932
|
-
|
|
4933
|
-
- Same logic tested at multiple levels
|
|
4934
|
-
- E2E tests for calculations
|
|
4935
|
-
- Integration tests for framework features
|
|
4936
|
-
|
|
4937
|
-
### Under-testing Smells
|
|
4938
|
-
|
|
4939
|
-
- No unit tests for complex logic
|
|
4940
|
-
- Missing integration tests for data operations
|
|
4941
|
-
- No E2E tests for critical user paths
|
|
4942
|
-
|
|
4943
|
-
### Wrong Level Smells
|
|
4601
|
+
### Output 2: Gate YAML Block
|
|
4944
4602
|
|
|
4945
|
-
|
|
4946
|
-
- E2E tests checking calculation results
|
|
4947
|
-
- Integration tests mocking everything
|
|
4603
|
+
Generate for inclusion in quality gate:
|
|
4948
4604
|
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
- One clear owner per test
|
|
4963
|
-
- Fast tests run first
|
|
4964
|
-
- Mock at boundaries, not internals
|
|
4965
|
-
- E2E for user value, not implementation
|
|
4966
|
-
- Maintain test/production parity where critical
|
|
4967
|
-
- Tests must be atomic and self-contained
|
|
4968
|
-
- No shared state between tests
|
|
4969
|
-
- Explicit assertions in test files (not helpers)
|
|
4605
|
+
```yaml
|
|
4606
|
+
test_design:
|
|
4607
|
+
scenarios_total: X
|
|
4608
|
+
by_level:
|
|
4609
|
+
unit: Y
|
|
4610
|
+
integration: Z
|
|
4611
|
+
e2e: W
|
|
4612
|
+
by_priority:
|
|
4613
|
+
p0: A
|
|
4614
|
+
p1: B
|
|
4615
|
+
p2: C
|
|
4616
|
+
coverage_gaps: [] # List any ACs without tests
|
|
4617
|
+
```
|
|
4970
4618
|
|
|
4971
|
-
### Output
|
|
4619
|
+
### Output 3: Trace References
|
|
4972
4620
|
|
|
4973
|
-
|
|
4621
|
+
Print for use by trace-requirements task:
|
|
4974
4622
|
|
|
4975
4623
|
```text
|
|
4976
|
-
Test design: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md
|
|
4624
|
+
Test design matrix: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md
|
|
4625
|
+
P0 tests identified: {count}
|
|
4977
4626
|
```
|
|
4978
4627
|
|
|
4979
|
-
|
|
4628
|
+
## Quality Checklist
|
|
4980
4629
|
|
|
4981
|
-
|
|
4630
|
+
Before finalizing, verify:
|
|
4982
4631
|
|
|
4983
|
-
|
|
4632
|
+
- [ ] Every AC has test coverage
|
|
4633
|
+
- [ ] Test levels are appropriate (not over-testing)
|
|
4634
|
+
- [ ] No duplicate coverage across levels
|
|
4635
|
+
- [ ] Priorities align with business risk
|
|
4636
|
+
- [ ] Test IDs follow naming convention
|
|
4637
|
+
- [ ] Scenarios are atomic and independent
|
|
4984
4638
|
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
by_priority:
|
|
4993
|
-
P0: { p0_count }
|
|
4994
|
-
P1: { p1_count }
|
|
4995
|
-
P2: { p2_count }
|
|
4996
|
-
coverage_gaps: [] # List any ACs without tests
|
|
4997
|
-
```
|
|
4639
|
+
## Key Principles
|
|
4640
|
+
|
|
4641
|
+
- **Shift left**: Prefer unit over integration, integration over E2E
|
|
4642
|
+
- **Risk-based**: Focus on what could go wrong
|
|
4643
|
+
- **Efficient coverage**: Test once at the right level
|
|
4644
|
+
- **Maintainability**: Consider long-term test maintenance
|
|
4645
|
+
- **Fast feedback**: Quick tests run first
|
|
4998
4646
|
==================== END: .bmad-core/tasks/test-design.md ====================
|
|
4999
4647
|
|
|
5000
4648
|
==================== START: .bmad-core/tasks/nfr-assess.md ====================
|
|
@@ -5006,12 +4654,12 @@ Quick NFR validation focused on the core four: security, performance, reliabilit
|
|
|
5006
4654
|
|
|
5007
4655
|
```yaml
|
|
5008
4656
|
required:
|
|
5009
|
-
- story_id:
|
|
5010
|
-
- story_path:
|
|
4657
|
+
- story_id: '{epic}.{story}' # e.g., "1.3"
|
|
4658
|
+
- story_path: 'docs/stories/{epic}.{story}.*.md'
|
|
5011
4659
|
|
|
5012
4660
|
optional:
|
|
5013
|
-
- architecture_refs:
|
|
5014
|
-
- technical_preferences:
|
|
4661
|
+
- architecture_refs: 'docs/architecture/*.md'
|
|
4662
|
+
- technical_preferences: 'docs/technical-preferences.md'
|
|
5015
4663
|
- acceptance_criteria: From story file
|
|
5016
4664
|
```
|
|
5017
4665
|
|
|
@@ -5092,16 +4740,16 @@ nfr_validation:
|
|
|
5092
4740
|
_assessed: [security, performance, reliability, maintainability]
|
|
5093
4741
|
security:
|
|
5094
4742
|
status: CONCERNS
|
|
5095
|
-
notes:
|
|
4743
|
+
notes: 'No rate limiting on auth endpoints'
|
|
5096
4744
|
performance:
|
|
5097
4745
|
status: PASS
|
|
5098
|
-
notes:
|
|
4746
|
+
notes: 'Response times < 200ms verified'
|
|
5099
4747
|
reliability:
|
|
5100
4748
|
status: PASS
|
|
5101
|
-
notes:
|
|
4749
|
+
notes: 'Error handling and retries implemented'
|
|
5102
4750
|
maintainability:
|
|
5103
4751
|
status: CONCERNS
|
|
5104
|
-
notes:
|
|
4752
|
+
notes: 'Test coverage at 65%, target is 80%'
|
|
5105
4753
|
```
|
|
5106
4754
|
|
|
5107
4755
|
## Deterministic Status Rules
|
|
@@ -5331,10 +4979,10 @@ performance_deep_dive:
|
|
|
5331
4979
|
p99: 350ms
|
|
5332
4980
|
database:
|
|
5333
4981
|
slow_queries: 2
|
|
5334
|
-
missing_indexes: [
|
|
4982
|
+
missing_indexes: ['users.email', 'orders.user_id']
|
|
5335
4983
|
caching:
|
|
5336
4984
|
hit_rate: 0%
|
|
5337
|
-
recommendation:
|
|
4985
|
+
recommendation: 'Add Redis for session data'
|
|
5338
4986
|
load_test:
|
|
5339
4987
|
max_rps: 150
|
|
5340
4988
|
breaking_point: 200 rps
|
|
@@ -5357,8 +5005,8 @@ template:
|
|
|
5357
5005
|
schema: 1
|
|
5358
5006
|
story: "{{epic_num}}.{{story_num}}"
|
|
5359
5007
|
story_title: "{{story_title}}"
|
|
5360
|
-
gate: "{{gate_status}}"
|
|
5361
|
-
status_reason: "{{status_reason}}"
|
|
5008
|
+
gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED
|
|
5009
|
+
status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision
|
|
5362
5010
|
reviewer: "Quinn (Test Architect)"
|
|
5363
5011
|
updated: "{{iso_timestamp}}"
|
|
5364
5012
|
|
|
@@ -5375,68 +5023,77 @@ risk_summary:
|
|
|
5375
5023
|
must_fix: []
|
|
5376
5024
|
monitor: []
|
|
5377
5025
|
|
|
5378
|
-
#
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5026
|
+
# Examples section using block scalars for clarity
|
|
5027
|
+
examples:
|
|
5028
|
+
with_issues: |
|
|
5029
|
+
top_issues:
|
|
5030
|
+
- id: "SEC-001"
|
|
5031
|
+
severity: high # ONLY: low|medium|high
|
|
5032
|
+
finding: "No rate limiting on login endpoint"
|
|
5033
|
+
suggested_action: "Add rate limiting middleware before production"
|
|
5034
|
+
- id: "TEST-001"
|
|
5035
|
+
severity: medium
|
|
5036
|
+
finding: "Missing integration tests for auth flow"
|
|
5037
|
+
suggested_action: "Add test coverage for critical paths"
|
|
5038
|
+
|
|
5039
|
+
when_waived: |
|
|
5040
|
+
waiver:
|
|
5041
|
+
active: true
|
|
5042
|
+
reason: "Accepted for MVP release - will address in next sprint"
|
|
5043
|
+
approved_by: "Product Owner"
|
|
5394
5044
|
|
|
5395
5045
|
# ============ Optional Extended Fields ============
|
|
5396
5046
|
# Uncomment and use if your team wants more detail
|
|
5397
5047
|
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
#
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
#
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
#
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
#
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
#
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5048
|
+
optional_fields_examples:
|
|
5049
|
+
quality_and_expiry: |
|
|
5050
|
+
quality_score: 75 # 0-100 (optional scoring)
|
|
5051
|
+
expires: "2025-01-26T00:00:00Z" # Optional gate freshness window
|
|
5052
|
+
|
|
5053
|
+
evidence: |
|
|
5054
|
+
evidence:
|
|
5055
|
+
tests_reviewed: 15
|
|
5056
|
+
risks_identified: 3
|
|
5057
|
+
trace:
|
|
5058
|
+
ac_covered: [1, 2, 3] # AC numbers with test coverage
|
|
5059
|
+
ac_gaps: [4] # AC numbers lacking coverage
|
|
5060
|
+
|
|
5061
|
+
nfr_validation: |
|
|
5062
|
+
nfr_validation:
|
|
5063
|
+
security: { status: CONCERNS, notes: "Rate limiting missing" }
|
|
5064
|
+
performance: { status: PASS, notes: "" }
|
|
5065
|
+
reliability: { status: PASS, notes: "" }
|
|
5066
|
+
maintainability: { status: PASS, notes: "" }
|
|
5067
|
+
|
|
5068
|
+
history: |
|
|
5069
|
+
history: # Append-only audit trail
|
|
5070
|
+
- at: "2025-01-12T10:00:00Z"
|
|
5071
|
+
gate: FAIL
|
|
5072
|
+
note: "Initial review - missing tests"
|
|
5073
|
+
- at: "2025-01-12T15:00:00Z"
|
|
5074
|
+
gate: CONCERNS
|
|
5075
|
+
note: "Tests added but rate limiting still missing"
|
|
5076
|
+
|
|
5077
|
+
risk_summary: |
|
|
5078
|
+
risk_summary: # From risk-profile task
|
|
5079
|
+
totals:
|
|
5080
|
+
critical: 0
|
|
5081
|
+
high: 0
|
|
5082
|
+
medium: 0
|
|
5083
|
+
low: 0
|
|
5084
|
+
# 'highest' is emitted only when risks exist
|
|
5085
|
+
recommendations:
|
|
5086
|
+
must_fix: []
|
|
5087
|
+
monitor: []
|
|
5088
|
+
|
|
5089
|
+
recommendations: |
|
|
5090
|
+
recommendations:
|
|
5091
|
+
immediate: # Must fix before production
|
|
5092
|
+
- action: "Add rate limiting to auth endpoints"
|
|
5093
|
+
refs: ["api/auth/login.ts:42-68"]
|
|
5094
|
+
future: # Can be addressed later
|
|
5095
|
+
- action: "Consider caching for better performance"
|
|
5096
|
+
refs: ["services/data.service.ts"]
|
|
5440
5097
|
==================== END: .bmad-core/templates/qa-gate-tmpl.yaml ====================
|
|
5441
5098
|
|
|
5442
5099
|
==================== START: .bmad-core/data/technical-preferences.md ====================
|