選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

test-design-qa-template.md 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. ---
  2. workflowStatus: ''
  3. totalSteps: 5
  4. stepsCompleted: []
  5. lastStep: ''
  6. nextStep: ''
  7. lastSaved: ''
  8. workflowType: 'testarch-test-design'
  9. inputDocuments: []
  10. ---
  11. # Test Design for QA: {Feature Name}
  12. **Purpose:** Test execution recipe for QA team. Defines what to test, how to test it, and what QA needs from other teams.
  13. **Date:** {date}
  14. **Author:** {author}
  15. **Status:** Draft
  16. **Project:** {project_name}
  17. **Related:** See Architecture doc (test-design-architecture.md) for testability concerns and architectural blockers.
  18. ---
  19. ## Executive Summary
  20. **Scope:** {Brief description of testing scope}
  21. **Risk Summary:**
  22. - Total Risks: {N} ({X} high-priority score ≥6, {Y} medium, {Z} low)
  23. - Critical Categories: {Categories with most high-priority risks}
  24. **Coverage Summary:**
  25. - P0 tests: ~{N} (critical paths, security)
  26. - P1 tests: ~{N} (important features, integration)
  27. - P2 tests: ~{N} (edge cases, regression)
  28. - P3 tests: ~{N} (exploratory, benchmarks)
  29. - **Total**: ~{N} tests (~{X}-{Y} weeks with 1 QA)
  30. ---
  31. ## Not in Scope
  32. **Components or systems explicitly excluded from this test plan:**
  33. | Item | Reasoning | Mitigation |
  34. | ---------- | --------------------------- | ------------------------------------------------------------------------------- |
  35. | **{Item}** | {Why excluded from testing} | {How risk is mitigated, e.g., "validated manually", "covered by upstream team"} |
  36. **Note:** Items listed here have been reviewed and accepted as out-of-scope by QA, Dev, and PM.
  37. ---
  38. ## Dependencies & Test Blockers
  39. **CRITICAL:** QA cannot proceed without these items from other teams.
  40. ### Backend/Architecture Dependencies (Pre-Implementation)
  41. **Source:** See Architecture doc "Quick Guide" for detailed mitigation plans
  42. 1. **{Dependency 1}** - {Team} - {Timeline}
  43. - {What QA needs}
  44. - {Why it blocks testing}
  45. 2. **{Dependency 2}** - {Team} - {Timeline}
  46. - {What QA needs}
  47. - {Why it blocks testing}
  48. ### QA Infrastructure Setup (Pre-Implementation)
  49. 1. **Test Data Factories** - QA
  50. - {Entity} factory with faker-based randomization
  51. - Auto-cleanup fixtures for parallel safety
  52. 2. **Test Environments** - QA
  53. - Local: {Setup details}
  54. - CI/CD: {Setup details}
  55. - Staging: {Setup details}
  56. **Example factory pattern:**
  57. ```typescript
  58. import { test } from '@seontechnologies/playwright-utils/api-request/fixtures';
  59. import { expect } from '@playwright/test';
  60. import { faker } from '@faker-js/faker';
  61. test('example test @p0', async ({ apiRequest }) => {
  62. const testData = {
  63. id: `test-${faker.string.uuid()}`,
  64. email: faker.internet.email(),
  65. };
  66. const { status } = await apiRequest({
  67. method: 'POST',
  68. path: '/api/resource',
  69. body: testData,
  70. });
  71. expect(status).toBe(201);
  72. });
  73. ```
  74. ---
  75. ## Risk Assessment
  76. **Note:** Full risk details in Architecture doc. This section summarizes risks relevant to QA test planning.
  77. ### High-Priority Risks (Score ≥6)
  78. | Risk ID | Category | Description | Score | QA Test Coverage |
  79. | ---------- | -------- | ------------------- | ----------- | ---------------------------- |
  80. | **{R-ID}** | {CAT} | {Brief description} | **{Score}** | {How QA validates this risk} |
  81. ### Medium/Low-Priority Risks
  82. | Risk ID | Category | Description | Score | QA Test Coverage |
  83. | ------- | -------- | ------------------- | ------- | ---------------------------- |
  84. | {R-ID} | {CAT} | {Brief description} | {Score} | {How QA validates this risk} |
  85. ---
  86. ## NFR Test Coverage Plan
  87. **Purpose:** Map NFR requirements to planned validation work. This section defines what evidence QA should create or collect; it does not assign final PASS/CONCERNS/FAIL status.
  88. | NFR Category | Requirement / Threshold | Planned Validation | Tool / Level | Evidence Artifact | Priority |
  89. | --------------- | ----------------------- | ------------------------------------------ | -------------------- | ----------------------------- | -------- |
  90. | Security | {Requirement} | {Auth/authz/security validation} | {API/E2E/SAST/DAST} | {Report or test result path} | {P0-P3} |
  91. | Performance | {Requirement} | {Load/stress/baseline validation} | {k6/APM/Lighthouse} | {Report or dashboard} | {P0-P3} |
  92. | Reliability | {Requirement} | {Error/retry/failover validation} | {API/E2E/monitoring} | {Burn-in/log/metric evidence} | {P0-P3} |
  93. | Maintainability | {Requirement} | {Coverage/static analysis/docs validation} | {CI/static analysis} | {Coverage or quality report} | {P0-P3} |
  94. **Missing thresholds or evidence sources:** {List NFRs that need stakeholder clarification or tooling before `nfr-assess`.}
  95. ---
  96. ## Entry Criteria
  97. **QA testing cannot begin until ALL of the following are met:**
  98. - [ ] All requirements and assumptions agreed upon by QA, Dev, PM
  99. - [ ] Test environments provisioned and accessible
  100. - [ ] Test data factories ready or seed data available
  101. - [ ] Pre-implementation blockers resolved (see Dependencies section)
  102. - [ ] Feature deployed to test environment
  103. - [ ] {Additional project-specific entry criteria}
  104. ## Exit Criteria
  105. **Testing phase is complete when ALL of the following are met:**
  106. - [ ] All P0 tests passing
  107. - [ ] All P1 tests passing (or failures triaged and accepted)
  108. - [ ] No open high-priority / high-severity bugs
  109. - [ ] Test coverage agreed as sufficient by QA Lead and Dev Lead
  110. - [ ] Performance baselines met (if applicable)
  111. - [ ] {Additional project-specific exit criteria}
  112. ---
  113. ## Project Team (Optional)
  114. **Include only if roles/names are known or responsibility mapping is needed; otherwise omit.**
  115. | Name | Role | Testing Responsibilities |
  116. | ------ | --------- | ------------------------------------------------------------- |
  117. | {Name} | QA Lead | Test strategy, E2E/API test implementation, test review |
  118. | {Name} | Dev Lead | Unit tests, integration test support, testability hooks |
  119. | {Name} | PM | Requirements clarification, acceptance criteria, UAT sign-off |
  120. | {Name} | Architect | Testability review, NFR guidance, environment provisioning |
  121. ---
  122. ## Test Coverage Plan
  123. **IMPORTANT:** P0/P1/P2/P3 = **priority and risk level** (what to focus on if time-constrained), NOT execution timing. See "Execution Strategy" for when tests run.
  124. ### P0 (Critical)
  125. **Criteria:** Blocks core functionality + High risk (≥6) + No workaround + Affects majority of users
  126. | Test ID | Requirement | Test Level | Risk Link | Notes |
  127. | ---------- | ------------- | ---------- | --------- | ------- |
  128. | **P0-001** | {Requirement} | {Level} | {R-ID} | {Notes} |
  129. | **P0-002** | {Requirement} | {Level} | {R-ID} | {Notes} |
  130. **Total P0:** ~{N} tests
  131. ---
  132. ### P1 (High)
  133. **Criteria:** Important features + Medium risk (3-4) + Common workflows + Workaround exists but difficult
  134. | Test ID | Requirement | Test Level | Risk Link | Notes |
  135. | ---------- | ------------- | ---------- | --------- | ------- |
  136. | **P1-001** | {Requirement} | {Level} | {R-ID} | {Notes} |
  137. | **P1-002** | {Requirement} | {Level} | {R-ID} | {Notes} |
  138. **Total P1:** ~{N} tests
  139. ---
  140. ### P2 (Medium)
  141. **Criteria:** Secondary features + Low risk (1-2) + Edge cases + Regression prevention
  142. | Test ID | Requirement | Test Level | Risk Link | Notes |
  143. | ---------- | ------------- | ---------- | --------- | ------- |
  144. | **P2-001** | {Requirement} | {Level} | {R-ID} | {Notes} |
  145. **Total P2:** ~{N} tests
  146. ---
  147. ### P3 (Low)
  148. **Criteria:** Nice-to-have + Exploratory + Performance benchmarks + Documentation validation
  149. | Test ID | Requirement | Test Level | Notes |
  150. | ---------- | ------------- | ---------- | ------- |
  151. | **P3-001** | {Requirement} | {Level} | {Notes} |
  152. **Total P3:** ~{N} tests
  153. ---
  154. ## Execution Strategy
  155. **Philosophy:** Run everything in PRs unless there's significant infrastructure overhead. Playwright with parallelization is extremely fast (100s of tests in ~10-15 min).
  156. **Organized by TOOL TYPE:**
  157. ### Every PR: Playwright Tests (~10-15 min)
  158. **All functional tests** (from any priority level):
  159. - All E2E, API, integration, unit tests using Playwright
  160. - Parallelized across {N} shards
  161. - Total: ~{N} Playwright tests (includes P0, P1, P2, P3)
  162. **Why run in PRs:** Fast feedback, no expensive infrastructure
  163. ### Nightly: k6 Performance Tests (~30-60 min)
  164. **All performance tests** (from any priority level):
  165. - Load, stress, spike, endurance tests
  166. - Total: ~{N} k6 tests (may include P0, P1, P2)
  167. **Why defer to nightly:** Expensive infrastructure (k6 Cloud), long-running (10-40 min per test)
  168. ### Weekly: Chaos & Long-Running (~hours)
  169. **Special infrastructure tests** (from any priority level):
  170. - Multi-region failover (requires AWS Fault Injection Simulator)
  171. - Disaster recovery (backup restore, 4+ hours)
  172. - Endurance tests (4+ hours runtime)
  173. **Why defer to weekly:** Very expensive infrastructure, very long-running, infrequent validation sufficient
  174. **Manual tests** (excluded from automation):
  175. - DevOps validation (deployment, monitoring)
  176. - Finance validation (cost alerts)
  177. - Documentation validation
  178. ---
  179. ## QA Effort Estimate
  180. **QA test development effort only** (excludes DevOps, Backend, Data Eng, Finance work):
  181. | Priority | Count | Effort Range | Notes |
  182. | --------- | ----- | ------------------ | ------------------------------------------------- |
  183. | P0 | ~{N} | ~{X}-{Y} weeks | Complex setup (security, performance, multi-step) |
  184. | P1 | ~{N} | ~{X}-{Y} weeks | Standard coverage (integration, API tests) |
  185. | P2 | ~{N} | ~{X}-{Y} days | Edge cases, simple validation |
  186. | P3 | ~{N} | ~{X}-{Y} days | Exploratory, benchmarks |
  187. | **Total** | ~{N} | **~{X}-{Y} weeks** | **1 QA engineer, full-time** |
  188. **Assumptions:**
  189. - Includes test design, implementation, debugging, CI integration
  190. - Excludes ongoing maintenance (~10% effort)
  191. - Assumes test infrastructure (factories, fixtures) ready
  192. **Dependencies from other teams:**
  193. - See "Dependencies & Test Blockers" section for what QA needs from Backend, DevOps, Data Eng
  194. ---
  195. ## Implementation Planning Handoff (Optional)
  196. **Include only if this test design produces implementation tasks that must be scheduled.**
  197. **Use this to inform implementation planning; if no dedicated QA, assign to Dev owners.**
  198. | Work Item | Owner | Target Milestone (Optional) | Dependencies/Notes |
  199. | ----------- | ------------ | --------------------------- | ------------------ |
  200. | {Work item} | {QA/Dev/etc} | {Milestone or date} | {Notes} |
  201. | {Work item} | {QA/Dev/etc} | {Milestone or date} | {Notes} |
  202. ---
  203. ## Tooling & Access
  204. **Include only if non-standard tools or access requests are required.**
  205. | Tool or Service | Purpose | Access Required | Status |
  206. | ----------------- | --------- | --------------- | ----------------- |
  207. | {Tool or Service} | {Purpose} | {Access needed} | {Ready / Pending} |
  208. | {Tool or Service} | {Purpose} | {Access needed} | {Ready / Pending} |
  209. **Access requests needed (if any):**
  210. - [ ] {Access to request}
  211. ---
  212. ## Interworking & Regression
  213. **Services and components impacted by this feature:**
  214. | Service/Component | Impact | Regression Scope | Validation Steps |
  215. | ----------------- | ------------------- | ------------------------------- | ----------------------------- |
  216. | **{Service}** | {How it's affected} | {What existing tests must pass} | {How to verify no regression} |
  217. **Regression test strategy:**
  218. - {Describe which existing test suites must pass before release}
  219. - {Note any cross-team coordination needed for regression validation}
  220. ---
  221. ## Appendix A: Code Examples & Tagging
  222. **Playwright Tags for Selective Execution:**
  223. ```typescript
  224. import { test } from '@seontechnologies/playwright-utils/api-request/fixtures';
  225. import { expect } from '@playwright/test';
  226. // P0 critical test
  227. test('@P0 @API @Security unauthenticated request returns 401', async ({ apiRequest }) => {
  228. const { status, body } = await apiRequest({
  229. method: 'POST',
  230. path: '/api/endpoint',
  231. body: { data: 'test' },
  232. skipAuth: true,
  233. });
  234. expect(status).toBe(401);
  235. expect(body.error).toContain('unauthorized');
  236. });
  237. // P1 integration test
  238. test('@P1 @Integration data syncs correctly', async ({ apiRequest }) => {
  239. // Seed data
  240. await apiRequest({
  241. method: 'POST',
  242. path: '/api/seed',
  243. body: {
  244. /* test data */
  245. },
  246. });
  247. // Validate
  248. const { status, body } = await apiRequest({
  249. method: 'GET',
  250. path: '/api/resource',
  251. });
  252. expect(status).toBe(200);
  253. expect(body).toHaveProperty('data');
  254. });
  255. ```
  256. **Run specific tags:**
  257. ```bash
  258. # Run only P0 tests
  259. npx playwright test --grep @P0
  260. # Run P0 + P1 tests
  261. npx playwright test --grep "@P0|@P1"
  262. # Run only security tests
  263. npx playwright test --grep @Security
  264. # Run all Playwright tests in PR (default)
  265. npx playwright test
  266. ```
  267. ---
  268. ## Appendix B: Knowledge Base References
  269. - **Risk Governance**: `risk-governance.md` - Risk scoring methodology
  270. - **Test Priorities Matrix**: `test-priorities-matrix.md` - P0-P3 criteria
  271. - **Test Levels Framework**: `test-levels-framework.md` - E2E vs API vs Unit selection
  272. - **Test Quality**: `test-quality.md` - Definition of Done (no hard waits, <300 lines, <1.5 min)
  273. ---
  274. **Generated by:** BMad TEA Agent
  275. **Workflow:** `bmad-testarch-test-design`
  276. **Version:** 4.0 (BMad v6)