bmad-method 6.0.0-alpha.17 → 6.0.0-alpha.19
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/CHANGELOG.md +117 -0
- package/package.json +1 -1
- package/src/modules/bmgd/_module-installer/installer.js +160 -0
- package/src/modules/bmgd/_module-installer/platform-specifics/claude-code.js +23 -0
- package/src/modules/bmgd/_module-installer/platform-specifics/windsurf.js +18 -0
- package/src/modules/bmgd/agents/game-architect.agent.yaml +23 -8
- package/src/modules/bmgd/agents/game-designer.agent.yaml +38 -18
- package/src/modules/bmgd/agents/game-dev.agent.yaml +30 -14
- package/src/modules/bmgd/agents/game-qa.agent.yaml +64 -0
- package/src/modules/bmgd/agents/game-scrum-master.agent.yaml +27 -39
- package/src/modules/bmgd/agents/game-solo-dev.agent.yaml +56 -0
- package/src/modules/bmgd/docs/README.md +180 -0
- package/src/modules/bmgd/docs/agents-guide.md +407 -0
- package/src/modules/bmgd/docs/game-types-guide.md +503 -0
- package/src/modules/bmgd/docs/glossary.md +294 -0
- package/src/modules/bmgd/docs/quick-flow-guide.md +288 -0
- package/src/modules/bmgd/docs/quick-start.md +250 -0
- package/src/modules/bmgd/docs/troubleshooting.md +259 -0
- package/src/modules/bmgd/docs/workflow-overview.jpg +0 -0
- package/src/modules/bmgd/docs/workflows-guide.md +463 -0
- package/src/modules/bmgd/gametest/knowledge/balance-testing.md +220 -0
- package/src/modules/bmgd/gametest/knowledge/certification-testing.md +319 -0
- package/src/modules/bmgd/gametest/knowledge/compatibility-testing.md +228 -0
- package/src/modules/bmgd/gametest/knowledge/godot-testing.md +376 -0
- package/src/modules/bmgd/gametest/knowledge/input-testing.md +315 -0
- package/src/modules/bmgd/gametest/knowledge/localization-testing.md +304 -0
- package/src/modules/bmgd/gametest/knowledge/multiplayer-testing.md +322 -0
- package/src/modules/bmgd/gametest/knowledge/performance-testing.md +204 -0
- package/src/modules/bmgd/gametest/knowledge/playtesting.md +384 -0
- package/src/modules/bmgd/gametest/knowledge/qa-automation.md +190 -0
- package/src/modules/bmgd/gametest/knowledge/regression-testing.md +280 -0
- package/src/modules/bmgd/gametest/knowledge/save-testing.md +280 -0
- package/src/modules/bmgd/gametest/knowledge/smoke-testing.md +404 -0
- package/src/modules/bmgd/gametest/knowledge/test-priorities.md +271 -0
- package/src/modules/bmgd/gametest/knowledge/unity-testing.md +383 -0
- package/src/modules/bmgd/gametest/knowledge/unreal-testing.md +388 -0
- package/src/modules/bmgd/gametest/qa-index.csv +17 -0
- package/src/modules/bmgd/module.yaml +25 -9
- package/src/modules/bmgd/teams/default-party.csv +2 -0
- package/src/modules/bmgd/teams/team-gamedev.yaml +12 -1
- package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-01-init.md +164 -0
- package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-02-context.md +210 -0
- package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-03-ideation.md +289 -0
- package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-04-complete.md +275 -0
- package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/workflow.md +49 -0
- package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/workflow.yaml +29 -8
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-01-init.md +223 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-01b-continue.md +151 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-02-vision.md +218 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-03-market.md +218 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-04-fundamentals.md +231 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-05-scope.md +242 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-06-references.md +224 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-07-content.md +282 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-08-complete.md +296 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/workflow.md +62 -0
- package/src/modules/bmgd/workflows/1-preproduction/game-brief/workflow.yaml +40 -9
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-01-init.md +248 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-01b-continue.md +173 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-02-context.md +332 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-03-platforms.md +245 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-04-vision.md +229 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-05-core-gameplay.md +258 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-06-mechanics.md +249 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-07-game-type.md +266 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-08-progression.md +272 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-09-levels.md +264 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-10-art-audio.md +255 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-11-technical.md +275 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-12-epics.md +284 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-13-metrics.md +250 -0
- package/src/modules/bmgd/workflows/2-design/gdd/steps/step-14-complete.md +335 -0
- package/src/modules/bmgd/workflows/2-design/gdd/workflow.md +61 -0
- package/src/modules/bmgd/workflows/2-design/gdd/workflow.yaml +27 -7
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-01-init.md +228 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-01b-continue.md +163 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-02-foundation.md +262 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-03-story.md +238 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-04-characters.md +297 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-05-world.md +262 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-06-dialogue.md +250 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-07-environmental.md +244 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-08-delivery.md +264 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-09-integration.md +254 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-10-production.md +262 -0
- package/src/modules/bmgd/workflows/2-design/narrative/steps/step-11-complete.md +331 -0
- package/src/modules/bmgd/workflows/2-design/narrative/workflow.md +57 -0
- package/src/modules/bmgd/workflows/2-design/narrative/workflow.yaml +53 -8
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-01-init.md +223 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-01b-continue.md +153 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-02-context.md +262 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-03-starter.md +290 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-04-decisions.md +300 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-05-crosscutting.md +319 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-06-structure.md +304 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-07-patterns.md +349 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-08-validation.md +293 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-09-complete.md +302 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/workflow.md +55 -0
- package/src/modules/bmgd/workflows/3-technical/game-architecture/workflow.yaml +50 -21
- package/src/modules/bmgd/workflows/4-production/code-review/checklist.md +23 -0
- package/src/modules/bmgd/workflows/4-production/code-review/instructions.xml +225 -0
- package/src/modules/bmgd/workflows/4-production/code-review/workflow.yaml +18 -15
- package/src/modules/bmgd/workflows/4-production/correct-course/checklist.md +1 -1
- package/src/modules/bmgd/workflows/4-production/correct-course/instructions.md +1 -1
- package/src/modules/bmgd/workflows/4-production/correct-course/workflow.yaml +11 -6
- package/src/modules/bmgd/workflows/4-production/create-story/checklist.md +332 -214
- package/src/modules/bmgd/workflows/4-production/create-story/instructions.xml +298 -0
- package/src/modules/bmgd/workflows/4-production/create-story/template.md +3 -5
- package/src/modules/bmgd/workflows/4-production/create-story/workflow.yaml +12 -7
- package/src/modules/bmgd/workflows/4-production/dev-story/checklist.md +65 -23
- package/src/modules/bmgd/workflows/4-production/dev-story/instructions.xml +409 -0
- package/src/modules/bmgd/workflows/4-production/dev-story/workflow.yaml +13 -3
- package/src/modules/bmgd/workflows/4-production/retrospective/instructions.md +4 -4
- package/src/modules/bmgd/workflows/4-production/retrospective/workflow.yaml +12 -7
- package/src/modules/bmgd/workflows/4-production/sprint-planning/instructions.md +32 -41
- package/src/modules/bmgd/workflows/4-production/sprint-planning/sprint-status-template.yaml +13 -13
- package/src/modules/bmgd/workflows/4-production/sprint-planning/workflow.yaml +6 -1
- package/src/modules/bmgd/workflows/4-production/sprint-status/instructions.md +229 -0
- package/src/modules/bmgd/workflows/4-production/sprint-status/workflow.yaml +35 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/create-tech-spec/instructions.md +140 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/create-tech-spec/workflow.yaml +27 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-dev/checklist.md +37 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-dev/instructions.md +220 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-dev/workflow.yaml +45 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-prototype/checklist.md +26 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-prototype/instructions.md +156 -0
- package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-prototype/workflow.yaml +36 -0
- package/src/modules/bmgd/workflows/gametest/automate/checklist.md +93 -0
- package/src/modules/bmgd/workflows/gametest/automate/instructions.md +317 -0
- package/src/modules/bmgd/workflows/gametest/automate/workflow.yaml +50 -0
- package/src/modules/bmgd/workflows/gametest/performance/checklist.md +96 -0
- package/src/modules/bmgd/workflows/gametest/performance/instructions.md +323 -0
- package/src/modules/bmgd/workflows/gametest/performance/performance-template.md +256 -0
- package/src/modules/bmgd/workflows/gametest/performance/workflow.yaml +48 -0
- package/src/modules/bmgd/workflows/gametest/playtest-plan/checklist.md +93 -0
- package/src/modules/bmgd/workflows/gametest/playtest-plan/instructions.md +297 -0
- package/src/modules/bmgd/workflows/gametest/playtest-plan/playtest-template.md +208 -0
- package/src/modules/bmgd/workflows/gametest/playtest-plan/workflow.yaml +59 -0
- package/src/modules/bmgd/workflows/gametest/test-design/checklist.md +98 -0
- package/src/modules/bmgd/workflows/gametest/test-design/instructions.md +280 -0
- package/src/modules/bmgd/workflows/gametest/test-design/test-design-template.md +205 -0
- package/src/modules/bmgd/workflows/gametest/test-design/workflow.yaml +47 -0
- package/src/modules/bmgd/workflows/gametest/test-framework/checklist.md +103 -0
- package/src/modules/bmgd/workflows/gametest/test-framework/instructions.md +348 -0
- package/src/modules/bmgd/workflows/gametest/test-framework/workflow.yaml +48 -0
- package/src/modules/bmgd/workflows/gametest/test-review/checklist.md +87 -0
- package/src/modules/bmgd/workflows/gametest/test-review/instructions.md +272 -0
- package/src/modules/bmgd/workflows/gametest/test-review/test-review-template.md +203 -0
- package/src/modules/bmgd/workflows/gametest/test-review/workflow.yaml +48 -0
- package/src/modules/bmgd/workflows/workflow-status/init/instructions.md +299 -0
- package/src/modules/bmgd/workflows/workflow-status/init/workflow.yaml +29 -0
- package/src/modules/bmgd/workflows/workflow-status/instructions.md +395 -0
- package/src/modules/bmgd/workflows/workflow-status/paths/gamedev-brownfield.yaml +65 -0
- package/src/modules/bmgd/workflows/workflow-status/paths/gamedev-greenfield.yaml +71 -0
- package/src/modules/bmgd/workflows/workflow-status/paths/quickflow-brownfield.yaml +29 -0
- package/src/modules/bmgd/workflows/workflow-status/paths/quickflow-greenfield.yaml +39 -0
- package/src/modules/bmgd/workflows/workflow-status/project-levels.yaml +63 -0
- package/src/modules/bmgd/workflows/workflow-status/workflow-status-template.yaml +24 -0
- package/src/modules/bmgd/workflows/workflow-status/workflow.yaml +30 -0
- package/tools/cli/commands/install.js +9 -0
- package/tools/cli/installers/lib/core/installer.js +140 -592
- package/tools/cli/installers/lib/modules/manager.js +15 -3
- package/tools/cli/lib/agent/compiler.js +99 -0
- package/tools/cli/lib/ui.js +78 -27
- package/src/modules/bmgd/workflows/2-design/gdd/instructions-gdd.md +0 -502
- package/src/modules/bmgd/workflows/4-production/code-review/instructions.md +0 -398
- package/src/modules/bmgd/workflows/4-production/create-story/instructions.md +0 -256
- package/src/modules/bmgd/workflows/4-production/dev-story/instructions.md +0 -267
- package/src/modules/bmgd/workflows/4-production/epic-tech-context/checklist.md +0 -17
- package/src/modules/bmgd/workflows/4-production/epic-tech-context/instructions.md +0 -164
- package/src/modules/bmgd/workflows/4-production/epic-tech-context/template.md +0 -76
- package/src/modules/bmgd/workflows/4-production/epic-tech-context/workflow.yaml +0 -58
- package/src/modules/bmgd/workflows/4-production/story-context/checklist.md +0 -16
- package/src/modules/bmgd/workflows/4-production/story-context/context-template.xml +0 -34
- package/src/modules/bmgd/workflows/4-production/story-context/instructions.md +0 -209
- package/src/modules/bmgd/workflows/4-production/story-context/workflow.yaml +0 -63
- package/src/modules/bmgd/workflows/4-production/story-done/instructions.md +0 -111
- package/src/modules/bmgd/workflows/4-production/story-done/workflow.yaml +0 -28
- package/src/modules/bmgd/workflows/4-production/story-ready/instructions.md +0 -117
- package/src/modules/bmgd/workflows/4-production/story-ready/workflow.yaml +0 -25
- /package/src/modules/bmgd/workflows/1-preproduction/game-brief/{template.md → templates/game-brief-template.md} +0 -0
- /package/src/modules/bmgd/workflows/2-design/gdd/{gdd-template.md → templates/gdd-template.md} +0 -0
- /package/src/modules/bmgd/workflows/2-design/narrative/{narrative-template.md → templates/narrative-template.md} +0 -0
- /package/src/modules/bmgd/workflows/3-technical/game-architecture/{architecture-template.md → templates/architecture-template.md} +0 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Test Priorities Matrix
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Not all tests are equal. This guide provides a framework for prioritizing test creation, execution, and maintenance based on risk, impact, and resources.
|
|
6
|
+
|
|
7
|
+
## Priority Levels
|
|
8
|
+
|
|
9
|
+
### P0 - Critical (Ship Blockers)
|
|
10
|
+
|
|
11
|
+
**Definition**: Failures that prevent the game from being playable or shippable.
|
|
12
|
+
|
|
13
|
+
| Criteria | Examples |
|
|
14
|
+
| ---------------------- | ------------------------------ |
|
|
15
|
+
| Game cannot start | Crash on launch, infinite load |
|
|
16
|
+
| Core loop broken | Cannot perform primary action |
|
|
17
|
+
| Data loss | Saves corrupted, progress lost |
|
|
18
|
+
| Platform certification | TRC/XR failures |
|
|
19
|
+
| Legal/compliance | Rating violations |
|
|
20
|
+
|
|
21
|
+
**Testing Approach**:
|
|
22
|
+
|
|
23
|
+
- Automated smoke tests on every build
|
|
24
|
+
- Manual verification before any release
|
|
25
|
+
- Zero tolerance for P0 bugs in release builds
|
|
26
|
+
|
|
27
|
+
### P1 - High (Major Features)
|
|
28
|
+
|
|
29
|
+
**Definition**: Significant functionality that affects most players' experience.
|
|
30
|
+
|
|
31
|
+
| Criteria | Examples |
|
|
32
|
+
| --------------------- | -------------------------------- |
|
|
33
|
+
| Major features broken | Multiplayer, progression systems |
|
|
34
|
+
| Frequent player paths | Main story, common actions |
|
|
35
|
+
| Significant UX issues | Confusing UI, missing feedback |
|
|
36
|
+
| Performance problems | Unplayable frame rates |
|
|
37
|
+
|
|
38
|
+
**Testing Approach**:
|
|
39
|
+
|
|
40
|
+
- Comprehensive automated tests
|
|
41
|
+
- Regular regression testing
|
|
42
|
+
- Full coverage in release candidates
|
|
43
|
+
|
|
44
|
+
### P2 - Medium (Standard Features)
|
|
45
|
+
|
|
46
|
+
**Definition**: Important functionality that affects significant portions of gameplay.
|
|
47
|
+
|
|
48
|
+
| Criteria | Examples |
|
|
49
|
+
| ------------------ | ----------------------------- |
|
|
50
|
+
| Secondary features | Side quests, optional content |
|
|
51
|
+
| Edge cases | Unusual player actions |
|
|
52
|
+
| Platform-specific | Single-platform issues |
|
|
53
|
+
| Minor progression | Non-critical collectibles |
|
|
54
|
+
|
|
55
|
+
**Testing Approach**:
|
|
56
|
+
|
|
57
|
+
- Selective automation
|
|
58
|
+
- Milestone regression testing
|
|
59
|
+
- Coverage prioritized by usage data
|
|
60
|
+
|
|
61
|
+
### P3 - Low (Polish Items)
|
|
62
|
+
|
|
63
|
+
**Definition**: Issues that are noticeable but don't significantly impact gameplay.
|
|
64
|
+
|
|
65
|
+
| Criteria | Examples |
|
|
66
|
+
| -------------- | ------------------------------ |
|
|
67
|
+
| Visual polish | Minor clipping, texture issues |
|
|
68
|
+
| Audio polish | Volume inconsistencies |
|
|
69
|
+
| Rare scenarios | Edge cases with workarounds |
|
|
70
|
+
| Nice-to-have | QoL improvements |
|
|
71
|
+
|
|
72
|
+
**Testing Approach**:
|
|
73
|
+
|
|
74
|
+
- Manual exploratory testing
|
|
75
|
+
- Automated only if easy/cheap
|
|
76
|
+
- Fixed as time permits
|
|
77
|
+
|
|
78
|
+
## Risk-Based Prioritization
|
|
79
|
+
|
|
80
|
+
### Risk Factors
|
|
81
|
+
|
|
82
|
+
| Factor | High Risk | Low Risk |
|
|
83
|
+
| ------------------- | ------------------- | --------------- |
|
|
84
|
+
| Usage frequency | Core loop | Rarely accessed |
|
|
85
|
+
| Player visibility | Always visible | Hidden/optional |
|
|
86
|
+
| Data impact | Saves, progression | Cosmetic only |
|
|
87
|
+
| Recovery difficulty | No workaround | Easy to retry |
|
|
88
|
+
| Change frequency | Frequently modified | Stable code |
|
|
89
|
+
|
|
90
|
+
### Risk Assessment Matrix
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
IMPACT
|
|
94
|
+
Low High
|
|
95
|
+
┌─────────┬─────────┐
|
|
96
|
+
High │ P2 │ P0 │
|
|
97
|
+
LIKELIHOOD ├─────────┼─────────┤
|
|
98
|
+
Low │ P3 │ P1 │
|
|
99
|
+
└─────────┴─────────┘
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Coverage Targets by Priority
|
|
103
|
+
|
|
104
|
+
| Priority | Unit Test | Integration | E2E/Smoke | Manual |
|
|
105
|
+
| -------- | --------- | ----------- | --------- | ----------- |
|
|
106
|
+
| P0 | 100% | 100% | Required | Pre-release |
|
|
107
|
+
| P1 | 80%+ | 80%+ | As needed | Milestone |
|
|
108
|
+
| P2 | 60%+ | Key paths | Optional | Sprint |
|
|
109
|
+
| P3 | Optional | Optional | No | Ad-hoc |
|
|
110
|
+
|
|
111
|
+
## Test Type Distribution
|
|
112
|
+
|
|
113
|
+
### Recommended Test Pyramid (Games)
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
▲
|
|
117
|
+
/│\
|
|
118
|
+
/ │ \ E2E/Smoke Tests (5%)
|
|
119
|
+
/ │ \ - Full game flow
|
|
120
|
+
/ │ \ - Platform certification
|
|
121
|
+
───────────
|
|
122
|
+
/ │ \
|
|
123
|
+
/ │ \ Integration Tests (25%)
|
|
124
|
+
/ │ \ - System interactions
|
|
125
|
+
/ │ \ - Network, save, audio
|
|
126
|
+
─────────────────────
|
|
127
|
+
/ │ \
|
|
128
|
+
/ │ \ Unit Tests (70%)
|
|
129
|
+
/ │ \ - Pure logic
|
|
130
|
+
/ │ \- Algorithms, calculations
|
|
131
|
+
───────────────────────────────
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Game-Specific Considerations
|
|
135
|
+
|
|
136
|
+
Unlike web apps, games have unique testing needs:
|
|
137
|
+
|
|
138
|
+
| Test Type | Standard App | Game-Specific |
|
|
139
|
+
| ----------- | -------------- | -------------------------- |
|
|
140
|
+
| Unit | Business logic | Damage calc, AI decisions |
|
|
141
|
+
| Integration | API + DB | Physics, audio, network |
|
|
142
|
+
| E2E | User flows | Gameplay scenarios |
|
|
143
|
+
| Additional | N/A | Playtesting, balance, feel |
|
|
144
|
+
|
|
145
|
+
## Execution Order
|
|
146
|
+
|
|
147
|
+
### CI Pipeline (Every Commit)
|
|
148
|
+
|
|
149
|
+
1. P0 smoke tests (5-10 minutes)
|
|
150
|
+
2. P0/P1 unit tests (10-15 minutes)
|
|
151
|
+
3. P0 integration tests (5-10 minutes)
|
|
152
|
+
|
|
153
|
+
### Daily/Nightly
|
|
154
|
+
|
|
155
|
+
1. Full P0 suite
|
|
156
|
+
2. Full P1 suite
|
|
157
|
+
3. P2 regression suite
|
|
158
|
+
4. Performance benchmarks
|
|
159
|
+
|
|
160
|
+
### Milestone/Release
|
|
161
|
+
|
|
162
|
+
1. All automated tests
|
|
163
|
+
2. Full P0-P2 manual testing
|
|
164
|
+
3. Platform certification tests
|
|
165
|
+
4. Exploratory testing
|
|
166
|
+
5. Performance profiling
|
|
167
|
+
|
|
168
|
+
## Bug Triage Criteria
|
|
169
|
+
|
|
170
|
+
### Priority Assignment
|
|
171
|
+
|
|
172
|
+
| Question | P0 | P1 | P2 | P3 |
|
|
173
|
+
| -------------------------- | ---- | --------- | ---- | ---- |
|
|
174
|
+
| Can player complete game? | No | Affected | No | No |
|
|
175
|
+
| How many players affected? | All | Most | Some | Few |
|
|
176
|
+
| Is there a workaround? | No | Difficult | Yes | Easy |
|
|
177
|
+
| Data at risk? | Yes | Possible | No | No |
|
|
178
|
+
| Platform certification? | Fail | Risk | Pass | Pass |
|
|
179
|
+
|
|
180
|
+
### Severity vs Priority
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
SEVERITY: How bad is the bug?
|
|
184
|
+
Critical → Crash, data loss
|
|
185
|
+
Major → Feature broken
|
|
186
|
+
Minor → Incorrect behavior
|
|
187
|
+
Trivial → Cosmetic
|
|
188
|
+
|
|
189
|
+
PRIORITY: How soon to fix?
|
|
190
|
+
P0 → Immediately (blocks release)
|
|
191
|
+
P1 → This sprint
|
|
192
|
+
P2 → This milestone
|
|
193
|
+
P3 → Backlog
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Resource Allocation
|
|
197
|
+
|
|
198
|
+
### QA Time Distribution
|
|
199
|
+
|
|
200
|
+
| Activity | Percentage |
|
|
201
|
+
| ---------------- | ---------- |
|
|
202
|
+
| P0 verification | 30% |
|
|
203
|
+
| P1 testing | 30% |
|
|
204
|
+
| P2 testing | 20% |
|
|
205
|
+
| Exploratory | 15% |
|
|
206
|
+
| Test maintenance | 5% |
|
|
207
|
+
|
|
208
|
+
### Automation Investment
|
|
209
|
+
|
|
210
|
+
| Priority | Automation Value | ROI |
|
|
211
|
+
| -------- | ---------------- | -------------- |
|
|
212
|
+
| P0 | Essential | Highest |
|
|
213
|
+
| P1 | High | High |
|
|
214
|
+
| P2 | Medium | Medium |
|
|
215
|
+
| P3 | Low | Often negative |
|
|
216
|
+
|
|
217
|
+
## Platform Priority Matrix
|
|
218
|
+
|
|
219
|
+
### Multi-Platform Prioritization
|
|
220
|
+
|
|
221
|
+
| Platform | Player Base | Certification | Testing Priority |
|
|
222
|
+
| ----------------------- | ----------- | ------------- | ----------------- |
|
|
223
|
+
| Primary (e.g., PC) | 60% | Light | P0: All, P1: All |
|
|
224
|
+
| Secondary (e.g., PS5) | 25% | Heavy | P0: All, P1: Most |
|
|
225
|
+
| Tertiary (e.g., Switch) | 15% | Medium | P0: All, P1: Core |
|
|
226
|
+
|
|
227
|
+
### Cross-Platform Testing Strategy
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
Platform Testing Coverage
|
|
231
|
+
|
|
232
|
+
PC PS5 Xbox Switch Mobile
|
|
233
|
+
P0 ████ ████ ████ ████ ████
|
|
234
|
+
P1 ████ ███░ ███░ ██░░ ██░░
|
|
235
|
+
P2 ███░ ██░░ ██░░ █░░░ █░░░
|
|
236
|
+
P3 ██░░ █░░░ █░░░ ░░░░ ░░░░
|
|
237
|
+
|
|
238
|
+
████ = Full coverage
|
|
239
|
+
███░ = High coverage
|
|
240
|
+
██░░ = Medium coverage
|
|
241
|
+
█░░░ = Low coverage
|
|
242
|
+
░░░░ = Minimal/none
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Best Practices
|
|
246
|
+
|
|
247
|
+
### DO
|
|
248
|
+
|
|
249
|
+
- Reassess priorities as development progresses
|
|
250
|
+
- Weight user-facing features higher
|
|
251
|
+
- Consider platform certification requirements
|
|
252
|
+
- Focus automation on stable, high-value areas
|
|
253
|
+
- Track bug escape rates by priority
|
|
254
|
+
|
|
255
|
+
### DON'T
|
|
256
|
+
|
|
257
|
+
- Treat all tests equally
|
|
258
|
+
- Automate P3 before P0/P1 coverage is solid
|
|
259
|
+
- Skip P0 testing for "small changes"
|
|
260
|
+
- Ignore platform-specific requirements
|
|
261
|
+
- Let P1/P2 bugs accumulate
|
|
262
|
+
|
|
263
|
+
## Metrics to Track
|
|
264
|
+
|
|
265
|
+
| Metric | Target | Purpose |
|
|
266
|
+
| ------------------- | ------------- | -------------------- |
|
|
267
|
+
| P0 test pass rate | 100% | Build quality |
|
|
268
|
+
| P0 bug escape rate | 0% | Test effectiveness |
|
|
269
|
+
| P1 coverage | 80%+ | Feature coverage |
|
|
270
|
+
| Test execution time | < 30 min (CI) | Development velocity |
|
|
271
|
+
| Flaky test rate | < 1% | Test reliability |
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
# Unity Test Framework Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Unity provides a built-in Test Framework based on NUnit for writing and running automated tests. It supports Edit Mode tests (run without playing) and Play Mode tests (run during gameplay simulation).
|
|
6
|
+
|
|
7
|
+
## Test Framework Setup
|
|
8
|
+
|
|
9
|
+
### Package Installation
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
// manifest.json - usually pre-installed
|
|
13
|
+
{
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"com.unity.test-framework": "1.6.0"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Project Structure
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Assets/
|
|
24
|
+
├── Scripts/
|
|
25
|
+
│ └── Runtime/
|
|
26
|
+
│ ├── Player/
|
|
27
|
+
│ │ └── PlayerController.cs
|
|
28
|
+
│ └── Combat/
|
|
29
|
+
│ └── DamageCalculator.cs
|
|
30
|
+
└── Tests/
|
|
31
|
+
├── EditMode/
|
|
32
|
+
│ └── DamageCalculatorTests.cs
|
|
33
|
+
└── PlayMode/
|
|
34
|
+
└── PlayerMovementTests.cs
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Assembly Definitions
|
|
38
|
+
|
|
39
|
+
Create `.asmdef` files for test assemblies:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
// Tests/EditMode/EditModeTests.asmdef
|
|
43
|
+
{
|
|
44
|
+
"name": "EditModeTests",
|
|
45
|
+
"references": ["GameAssembly"],
|
|
46
|
+
"includePlatforms": ["Editor"],
|
|
47
|
+
"defineConstraints": ["UNITY_INCLUDE_TESTS"]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Tests/PlayMode/PlayModeTests.asmdef
|
|
51
|
+
{
|
|
52
|
+
"name": "PlayModeTests",
|
|
53
|
+
"references": ["GameAssembly"],
|
|
54
|
+
"includePlatforms": [],
|
|
55
|
+
"defineConstraints": ["UNITY_INCLUDE_TESTS"]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Edit Mode Tests
|
|
60
|
+
|
|
61
|
+
Edit Mode tests run in the Editor without entering Play Mode. Best for testing pure logic.
|
|
62
|
+
|
|
63
|
+
### Basic Test Structure
|
|
64
|
+
|
|
65
|
+
```csharp
|
|
66
|
+
using NUnit.Framework;
|
|
67
|
+
|
|
68
|
+
[TestFixture]
|
|
69
|
+
public class DamageCalculatorTests
|
|
70
|
+
{
|
|
71
|
+
private DamageCalculator _calculator;
|
|
72
|
+
|
|
73
|
+
[SetUp]
|
|
74
|
+
public void Setup()
|
|
75
|
+
{
|
|
76
|
+
_calculator = new DamageCalculator();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[Test]
|
|
80
|
+
public void Calculate_BaseDamage_ReturnsCorrectValue()
|
|
81
|
+
{
|
|
82
|
+
float result = _calculator.Calculate(100f, 1f);
|
|
83
|
+
Assert.AreEqual(100f, result);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[Test]
|
|
87
|
+
public void Calculate_CriticalHit_DoublesDamage()
|
|
88
|
+
{
|
|
89
|
+
float result = _calculator.Calculate(100f, multiplier: 2f);
|
|
90
|
+
Assert.AreEqual(200f, result);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[TestCase(100f, 0.5f, 50f)]
|
|
94
|
+
[TestCase(100f, 1.5f, 150f)]
|
|
95
|
+
[TestCase(50f, 2f, 100f)]
|
|
96
|
+
public void Calculate_Parameterized_ReturnsExpected(
|
|
97
|
+
float base_, float mult, float expected)
|
|
98
|
+
{
|
|
99
|
+
Assert.AreEqual(expected, _calculator.Calculate(base_, mult));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Testing ScriptableObjects
|
|
105
|
+
|
|
106
|
+
```csharp
|
|
107
|
+
[Test]
|
|
108
|
+
public void WeaponStats_DPS_CalculatesCorrectly()
|
|
109
|
+
{
|
|
110
|
+
var weapon = ScriptableObject.CreateInstance<WeaponStats>();
|
|
111
|
+
weapon.baseDamage = 10f;
|
|
112
|
+
weapon.attacksPerSecond = 2f;
|
|
113
|
+
|
|
114
|
+
Assert.AreEqual(20f, weapon.DPS);
|
|
115
|
+
|
|
116
|
+
// Cleanup
|
|
117
|
+
Object.DestroyImmediate(weapon);
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Play Mode Tests
|
|
122
|
+
|
|
123
|
+
Play Mode tests run during gameplay simulation. Required for testing MonoBehaviours, physics, and runtime behavior.
|
|
124
|
+
|
|
125
|
+
### Basic Play Mode Test
|
|
126
|
+
|
|
127
|
+
```csharp
|
|
128
|
+
using System.Collections;
|
|
129
|
+
using NUnit.Framework;
|
|
130
|
+
using UnityEngine;
|
|
131
|
+
using UnityEngine.TestTools;
|
|
132
|
+
|
|
133
|
+
public class PlayerMovementTests
|
|
134
|
+
{
|
|
135
|
+
private GameObject _player;
|
|
136
|
+
private PlayerController _controller;
|
|
137
|
+
|
|
138
|
+
[SetUp]
|
|
139
|
+
public void Setup()
|
|
140
|
+
{
|
|
141
|
+
_player = new GameObject("Player");
|
|
142
|
+
_controller = _player.AddComponent<PlayerController>();
|
|
143
|
+
_player.AddComponent<Rigidbody>();
|
|
144
|
+
_player.AddComponent<CapsuleCollider>();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[TearDown]
|
|
148
|
+
public void TearDown()
|
|
149
|
+
{
|
|
150
|
+
Object.Destroy(_player);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[UnityTest]
|
|
154
|
+
public IEnumerator Move_WhenInputApplied_ChangesPosition()
|
|
155
|
+
{
|
|
156
|
+
Vector3 startPos = _player.transform.position;
|
|
157
|
+
|
|
158
|
+
_controller.SetInput(Vector2.right);
|
|
159
|
+
|
|
160
|
+
yield return new WaitForSeconds(0.5f);
|
|
161
|
+
|
|
162
|
+
Assert.Greater(_player.transform.position.x, startPos.x);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[UnityTest]
|
|
166
|
+
public IEnumerator Jump_WhenGrounded_BecomesAirborne()
|
|
167
|
+
{
|
|
168
|
+
// Setup ground
|
|
169
|
+
var ground = GameObject.CreatePrimitive(PrimitiveType.Plane);
|
|
170
|
+
_player.transform.position = Vector3.up;
|
|
171
|
+
|
|
172
|
+
yield return new WaitForFixedUpdate();
|
|
173
|
+
|
|
174
|
+
_controller.Jump();
|
|
175
|
+
|
|
176
|
+
yield return new WaitForSeconds(0.1f);
|
|
177
|
+
|
|
178
|
+
Assert.IsFalse(_controller.IsGrounded);
|
|
179
|
+
|
|
180
|
+
Object.Destroy(ground);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Testing Coroutines
|
|
186
|
+
|
|
187
|
+
```csharp
|
|
188
|
+
[UnityTest]
|
|
189
|
+
public IEnumerator Attack_Cooldown_PreventsSpam()
|
|
190
|
+
{
|
|
191
|
+
_controller.Attack();
|
|
192
|
+
Assert.IsTrue(_controller.IsAttacking);
|
|
193
|
+
|
|
194
|
+
_controller.Attack(); // Should be blocked
|
|
195
|
+
Assert.AreEqual(1, _controller.AttackCount);
|
|
196
|
+
|
|
197
|
+
yield return new WaitForSeconds(_controller.AttackCooldown + 0.1f);
|
|
198
|
+
|
|
199
|
+
_controller.Attack();
|
|
200
|
+
Assert.AreEqual(2, _controller.AttackCount);
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Scene Testing
|
|
205
|
+
|
|
206
|
+
```csharp
|
|
207
|
+
using UnityEngine.SceneManagement;
|
|
208
|
+
|
|
209
|
+
[UnityTest]
|
|
210
|
+
public IEnumerator MainMenu_StartButton_LoadsGameScene()
|
|
211
|
+
{
|
|
212
|
+
SceneManager.LoadScene("MainMenu");
|
|
213
|
+
yield return null; // Wait for scene load
|
|
214
|
+
|
|
215
|
+
var startButton = GameObject.Find("StartButton")
|
|
216
|
+
.GetComponent<Button>();
|
|
217
|
+
startButton.onClick.Invoke();
|
|
218
|
+
|
|
219
|
+
yield return new WaitForSeconds(1f);
|
|
220
|
+
|
|
221
|
+
Assert.AreEqual("GameScene", SceneManager.GetActiveScene().name);
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Integration Test Patterns
|
|
226
|
+
|
|
227
|
+
### Prefab Testing
|
|
228
|
+
|
|
229
|
+
```csharp
|
|
230
|
+
[UnityTest]
|
|
231
|
+
public IEnumerator EnemyPrefab_Spawns_WithCorrectComponents()
|
|
232
|
+
{
|
|
233
|
+
var prefab = Resources.Load<GameObject>("Prefabs/Enemy");
|
|
234
|
+
var instance = Object.Instantiate(prefab);
|
|
235
|
+
|
|
236
|
+
yield return null;
|
|
237
|
+
|
|
238
|
+
Assert.IsNotNull(instance.GetComponent<EnemyAI>());
|
|
239
|
+
Assert.IsNotNull(instance.GetComponent<Health>());
|
|
240
|
+
Assert.IsNotNull(instance.GetComponent<NavMeshAgent>());
|
|
241
|
+
|
|
242
|
+
Object.Destroy(instance);
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Input System Testing
|
|
247
|
+
|
|
248
|
+
```csharp
|
|
249
|
+
using UnityEngine.InputSystem;
|
|
250
|
+
|
|
251
|
+
[UnityTest]
|
|
252
|
+
public IEnumerator InputAction_Fire_TriggersWeapon()
|
|
253
|
+
{
|
|
254
|
+
var keyboard = InputSystem.AddDevice<Keyboard>();
|
|
255
|
+
|
|
256
|
+
yield return null;
|
|
257
|
+
|
|
258
|
+
Press(keyboard.spaceKey);
|
|
259
|
+
yield return null;
|
|
260
|
+
|
|
261
|
+
Assert.IsTrue(_controller.IsFiring);
|
|
262
|
+
|
|
263
|
+
Release(keyboard.spaceKey);
|
|
264
|
+
yield return null;
|
|
265
|
+
|
|
266
|
+
Assert.IsFalse(_controller.IsFiring);
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Test Utilities
|
|
271
|
+
|
|
272
|
+
### Custom Assertions
|
|
273
|
+
|
|
274
|
+
```csharp
|
|
275
|
+
public static class GameAssert
|
|
276
|
+
{
|
|
277
|
+
public static void AreApproximatelyEqual(
|
|
278
|
+
Vector3 expected, Vector3 actual, float tolerance = 0.001f)
|
|
279
|
+
{
|
|
280
|
+
Assert.AreEqual(expected.x, actual.x, tolerance);
|
|
281
|
+
Assert.AreEqual(expected.y, actual.y, tolerance);
|
|
282
|
+
Assert.AreEqual(expected.z, actual.z, tolerance);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
public static void IsWithinRange(float value, float min, float max)
|
|
286
|
+
{
|
|
287
|
+
Assert.GreaterOrEqual(value, min);
|
|
288
|
+
Assert.LessOrEqual(value, max);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Test Fixtures
|
|
294
|
+
|
|
295
|
+
```csharp
|
|
296
|
+
public class TestScene : IDisposable
|
|
297
|
+
{
|
|
298
|
+
public GameObject Player { get; private set; }
|
|
299
|
+
public GameObject Ground { get; private set; }
|
|
300
|
+
|
|
301
|
+
public TestScene()
|
|
302
|
+
{
|
|
303
|
+
Ground = GameObject.CreatePrimitive(PrimitiveType.Plane);
|
|
304
|
+
Player = Object.Instantiate(Resources.Load<GameObject>("Player"));
|
|
305
|
+
Player.transform.position = Vector3.up;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
public void Dispose()
|
|
309
|
+
{
|
|
310
|
+
Object.Destroy(Player);
|
|
311
|
+
Object.Destroy(Ground);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
[UnityTest]
|
|
316
|
+
public IEnumerator Player_FallsToGround()
|
|
317
|
+
{
|
|
318
|
+
using var scene = new TestScene();
|
|
319
|
+
|
|
320
|
+
yield return new WaitForSeconds(1f);
|
|
321
|
+
|
|
322
|
+
Assert.Less(scene.Player.transform.position.y, 0.5f);
|
|
323
|
+
}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## CI Integration
|
|
327
|
+
|
|
328
|
+
### Command Line Execution
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Run Edit Mode tests
|
|
332
|
+
Unity -runTests -batchmode -projectPath . \
|
|
333
|
+
-testPlatform EditMode \
|
|
334
|
+
-testResults results.xml
|
|
335
|
+
|
|
336
|
+
# Run Play Mode tests
|
|
337
|
+
Unity -runTests -batchmode -projectPath . \
|
|
338
|
+
-testPlatform PlayMode \
|
|
339
|
+
-testResults results.xml
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### GitHub Actions
|
|
343
|
+
|
|
344
|
+
```yaml
|
|
345
|
+
test:
|
|
346
|
+
runs-on: ubuntu-latest
|
|
347
|
+
steps:
|
|
348
|
+
- uses: game-ci/unity-test-runner@v4
|
|
349
|
+
with:
|
|
350
|
+
projectPath: .
|
|
351
|
+
testMode: all
|
|
352
|
+
artifactsPath: TestResults
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Best Practices
|
|
356
|
+
|
|
357
|
+
### DO
|
|
358
|
+
|
|
359
|
+
- Test pure logic in Edit Mode (faster execution)
|
|
360
|
+
- Use Play Mode only when needed (physics, coroutines, MonoBehaviour)
|
|
361
|
+
- Create test fixtures for common setups
|
|
362
|
+
- Clean up created GameObjects in TearDown
|
|
363
|
+
- Use `[Category]` attributes for test organization
|
|
364
|
+
- Run tests before every commit
|
|
365
|
+
|
|
366
|
+
### DON'T
|
|
367
|
+
|
|
368
|
+
- Don't test Unity's built-in functionality
|
|
369
|
+
- Don't rely on specific frame timing (use WaitForSeconds)
|
|
370
|
+
- Don't leave test objects in scenes
|
|
371
|
+
- Don't test private methods directly (test through public API)
|
|
372
|
+
- Don't create tests that depend on execution order
|
|
373
|
+
|
|
374
|
+
## Troubleshooting
|
|
375
|
+
|
|
376
|
+
### Common Issues
|
|
377
|
+
|
|
378
|
+
| Issue | Cause | Fix |
|
|
379
|
+
| ---------------------- | ------------------ | ------------------------------------------ |
|
|
380
|
+
| Tests not appearing | Missing asmdef | Create test assembly definition |
|
|
381
|
+
| NullReferenceException | Missing Setup | Ensure [SetUp] initializes all fields |
|
|
382
|
+
| Tests hang | Infinite coroutine | Add timeout or max iterations |
|
|
383
|
+
| Flaky physics tests | Timing dependent | Use WaitForFixedUpdate, increase tolerance |
|