@anhth2/spec-driven-dev-plugin 0.10.0 → 0.12.0
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/commands/debug.md +43 -8
- package/commands/define-product.md +43 -8
- package/commands/dev-gen-test.md +44 -9
- package/commands/dev-gen-test.tmpl +1 -1
- package/commands/dev-run-test.md +48 -10
- package/commands/dev-run-test.tmpl +5 -2
- package/commands/dev-smoke-test.md +43 -8
- package/commands/fix-bug.md +79 -14
- package/commands/fix-bug.tmpl +36 -6
- package/commands/generate-bdd.md +49 -10
- package/commands/generate-bdd.tmpl +6 -2
- package/commands/generate-code.md +44 -9
- package/commands/generate-code.tmpl +1 -1
- package/commands/generate-design-spec.md +43 -8
- package/commands/generate-prd.md +43 -8
- package/commands/generate-spec-manifest.md +43 -8
- package/commands/generate-tech-docs.md +43 -8
- package/commands/learn.md +43 -8
- package/commands/propose-scenario.md +74 -19
- package/commands/propose-scenario.tmpl +31 -11
- package/commands/qc-analyze.md +534 -0
- package/commands/qc-analyze.tmpl +86 -0
- package/commands/qc-design-test.md +515 -0
- package/commands/qc-design-test.tmpl +67 -0
- package/commands/qc-plan.md +497 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +508 -0
- package/commands/qc-report.tmpl +60 -0
- package/commands/qc-review.md +501 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +549 -0
- package/commands/qc-run-test.tmpl +83 -0
- package/commands/refine-prd.md +43 -8
- package/commands/report-bug.md +59 -10
- package/commands/report-bug.tmpl +16 -2
- package/commands/review-code.md +43 -8
- package/commands/review-context.md +43 -8
- package/commands/review-tech-docs.md +43 -8
- package/commands/setup-ai-first.md +7 -0
- package/commands/sync.md +19 -9
- package/commands/sync.tmpl +12 -9
- package/commands/update-framework.md +7 -0
- package/commands/validate-traces.md +67 -12
- package/commands/validate-traces.tmpl +24 -4
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +43 -8
- package/core/commands/define-product.md +43 -8
- package/core/commands/dev-gen-test.md +44 -9
- package/core/commands/dev-run-test.md +48 -10
- package/core/commands/dev-smoke-test.md +43 -8
- package/core/commands/fix-bug.md +79 -14
- package/core/commands/generate-bdd.md +49 -10
- package/core/commands/generate-code.md +44 -9
- package/core/commands/generate-design-spec.md +43 -8
- package/core/commands/generate-prd.md +43 -8
- package/core/commands/generate-spec-manifest.md +43 -8
- package/core/commands/generate-tech-docs.md +43 -8
- package/core/commands/learn.md +43 -8
- package/core/commands/propose-scenario.md +74 -19
- package/core/commands/qc-analyze.md +534 -0
- package/core/commands/qc-design-test.md +515 -0
- package/core/commands/qc-plan.md +497 -0
- package/core/commands/qc-report.md +508 -0
- package/core/commands/qc-review.md +501 -0
- package/core/commands/qc-run-test.md +549 -0
- package/core/commands/refine-prd.md +43 -8
- package/core/commands/report-bug.md +59 -10
- package/core/commands/review-code.md +43 -8
- package/core/commands/review-context.md +43 -8
- package/core/commands/review-tech-docs.md +43 -8
- package/core/commands/setup-ai-first.md +7 -0
- package/core/commands/sync.md +19 -9
- package/core/commands/update-framework.md +7 -0
- package/core/commands/validate-traces.md +67 -12
- package/core/modules/qc-playwright/stack-profile.yaml +65 -0
- package/core/skills/code/SKILL.md +50 -8
- package/core/skills/debug/SKILL.md +57 -8
- package/core/skills/design-spec/SKILL.md +43 -8
- package/core/skills/discovery/SKILL.md +43 -8
- package/core/skills/prd/SKILL.md +14 -0
- package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/core/skills/qc/qa-analyst/business-rules.md +59 -0
- package/core/skills/qc/qa-analyst/data-flow.md +64 -0
- package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
- package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/core/skills/qc/qa-designer/functional/api.md +45 -0
- package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/core/skills/qc/qa-designer/integration/api.md +42 -0
- package/core/skills/qc/qa-designer/integration/db.md +39 -0
- package/core/skills/qc/qa-designer/integration/gui.md +40 -0
- package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/core/skills/qc/qa-designer/non-functional.md +40 -0
- package/core/skills/qc/qa-planner/test-plan.md +120 -0
- package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/core/skills/qc/qa-runner/e2e.md +49 -0
- package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/core/skills/qc/qa-runner/functional/api.md +35 -0
- package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/core/skills/qc/qa-runner/integration.md +47 -0
- package/core/skills/qc/qa-runner/non-functional.md +49 -0
- package/core/skills/qc/qa-runner/report/report.md +37 -0
- package/core/skills/setup-ai-first/SKILL.md +7 -0
- package/core/skills/spec/SKILL.md +14 -0
- package/core/skills/test/SKILL.md +93 -16
- package/core/steps/context-loader.md +36 -8
- package/core/steps/report-footer.md +7 -0
- package/core/templates/project-context.yaml +27 -1
- package/docs/01-getting-started/README.md +19 -0
- package/docs/01-getting-started/core-concepts.md +102 -0
- package/docs/01-getting-started/installation.md +156 -0
- package/docs/01-getting-started/quickstart.md +85 -0
- package/docs/02-guides/README.md +27 -0
- package/docs/02-guides/developer/README.md +46 -0
- package/docs/02-guides/developer/bdd-and-trace.md +123 -0
- package/docs/02-guides/developer/commands.md +76 -0
- package/docs/02-guides/developer/pr-checklist.md +15 -0
- package/docs/02-guides/developer/scenarios.md +448 -0
- package/docs/02-guides/developer/workflow.md +61 -0
- package/docs/02-guides/product-owner/README.md +77 -0
- package/docs/02-guides/product-owner/commands.md +30 -0
- package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
- package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
- package/docs/02-guides/product-owner/scenarios.md +357 -0
- package/docs/02-guides/qc-automation.md +157 -0
- package/docs/02-guides/tester/README.md +74 -0
- package/docs/02-guides/tester/bug-reporting.md +117 -0
- package/docs/02-guides/tester/reading-specs.md +79 -0
- package/docs/02-guides/tester/scenarios.md +186 -0
- package/docs/02-guides/tester/spec-manifest.md +124 -0
- package/docs/02-guides/tester/test-checklist.md +31 -0
- package/docs/02-guides/tester/workflow.md +80 -0
- package/docs/03-concepts/README.md +19 -0
- package/docs/03-concepts/architecture.md +245 -0
- package/docs/03-concepts/pipeline.md +262 -0
- package/docs/03-concepts/traceability.md +149 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +362 -0
- package/docs/04-operations/publishing.md +137 -0
- package/docs/04-operations/sync-and-update.md +365 -0
- package/docs/05-reference/README.md +29 -0
- package/docs/05-reference/commands.md +229 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +152 -0
- package/docs/README.md +51 -0
- package/modules/qc-playwright/stack-profile.yaml +65 -0
- package/package.json +2 -2
- package/skills/code/SKILL.md +50 -8
- package/skills/debug/SKILL.md +57 -8
- package/skills/design-spec/SKILL.md +43 -8
- package/skills/discovery/SKILL.md +43 -8
- package/skills/prd/SKILL.md +14 -0
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/skills/qc/qa-analyst/business-rules.md +59 -0
- package/skills/qc/qa-analyst/data-flow.md +64 -0
- package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
- package/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/skills/qc/qa-designer/functional/api.md +45 -0
- package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/skills/qc/qa-designer/integration/api.md +42 -0
- package/skills/qc/qa-designer/integration/db.md +39 -0
- package/skills/qc/qa-designer/integration/gui.md +40 -0
- package/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/skills/qc/qa-designer/non-functional.md +40 -0
- package/skills/qc/qa-planner/test-plan.md +120 -0
- package/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/skills/qc/qa-runner/e2e.md +49 -0
- package/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/skills/qc/qa-runner/functional/api.md +35 -0
- package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/skills/qc/qa-runner/integration.md +47 -0
- package/skills/qc/qa-runner/non-functional.md +49 -0
- package/skills/qc/qa-runner/report/report.md +37 -0
- package/skills/setup-ai-first/SKILL.md +7 -0
- package/skills/spec/SKILL.md +14 -0
- package/skills/test/SKILL.md +93 -16
- package/steps/context-loader.md +36 -8
- package/steps/report-footer.md +7 -0
- package/templates/project-context.yaml +27 -1
- package/ARCHITECTURE.md +0 -258
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Guides](README.md) › QC Automation
|
|
2
|
+
|
|
3
|
+
# Hướng Dẫn QC Automation — Spec-Driven Dev
|
|
4
|
+
|
|
5
|
+
Pipeline QC automation **chính thức** của framework — được port từ agent của team QC (reference repo `ai-automation-qc-base`) vào ngay trong framework. Nó sinh và chạy automation **Playwright/pytest** từ BDD `.feature` chính thức, rồi ghi tín hiệu **`qc_status`** (authoritative) vào trace TSV → Living Docs.
|
|
6
|
+
|
|
7
|
+
## Mục Lục
|
|
8
|
+
|
|
9
|
+
- [Hai luồng test: dev self-check vs QC chính thức](#hai-luồng-test-dev-self-check-vs-qc-chính-thức)
|
|
10
|
+
- [Pipeline 6 bước](#pipeline-6-bước)
|
|
11
|
+
- [Stack — module qc-playwright](#stack--module-qc-playwright)
|
|
12
|
+
- [Trace join: qc_status đến Living Docs như thế nào](#trace-join-qc_status-đến-living-docs-như-thế-nào)
|
|
13
|
+
- [Entry point](#entry-point)
|
|
14
|
+
- [Skills theo layer](#skills-theo-layer)
|
|
15
|
+
|
|
16
|
+
## Hai Luồng Test: Dev Self-Check vs QC Chính Thức
|
|
17
|
+
|
|
18
|
+
Pipeline QC này **khác** với developer **self-check** (`/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test`):
|
|
19
|
+
|
|
20
|
+
| Signal | Owner | Command | Ý nghĩa |
|
|
21
|
+
|--------|-------|---------|---------|
|
|
22
|
+
| `dev_selftest` | Dev | `/dev-run-test` | smoke check của riêng dev (KHÔNG authoritative) |
|
|
23
|
+
| `qc_status` | QC | `/qc-run-test` | kết quả QC automation **chính thức** |
|
|
24
|
+
|
|
25
|
+
Cả hai hiển thị **cạnh nhau** trong Living Docs; không cái nào ghi đè cái nào. `dev_selftest: pass` chỉ nghĩa "dev đã tự smoke qua"; coverage chính thức nằm ở `qc_status`.
|
|
26
|
+
|
|
27
|
+
## Pipeline 6 Bước
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report
|
|
31
|
+
(requirement (risk/plan (test-case (review (gen+run (report +
|
|
32
|
+
breakdown) + Q-for-dev) .Test.md) gate) Python → evidence)
|
|
33
|
+
qc_status)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Command | Vai trò | Output |
|
|
37
|
+
|---------|---------|--------|
|
|
38
|
+
| `/qc-analyze` | bóc tách spec chính thức thành **1 file phân tích gộp** (requirement + BR/AC + data-flow) + `DOC_GAPS` | `{qc_dir}/{UC-ID}/` → `REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md` (**2 file**) |
|
|
39
|
+
| `/qc-plan` | risk / what-if / questions-for-dev + test plan | `TEST_PLAN.md` |
|
|
40
|
+
| `/qc-design-test` | thiết kế test case (Markdown `.Test.md`), tag `@trace.verifies={UC-ID}-SC{N}` | `test-cases/` |
|
|
41
|
+
| `/qc-review` | cổng review hai chiều: review test case (sau design) và script (sau run) | findings |
|
|
42
|
+
| `/qc-run-test` | sinh + chạy Python pytest-playwright; **ghi `qc_status`** per scenario | `{trace_dir}/{UC-ID}.tsv` |
|
|
43
|
+
| `/qc-report` | report pytest-html + Playwright trace + evidence | `reports/<feature>/report.html` |
|
|
44
|
+
|
|
45
|
+
> **Nơi lưu artifact (`qc_dir`):** mọi output của pipeline (trừ report) nằm trong thư mục QC
|
|
46
|
+
> **lộ ra ngoài** `{qc_dir}/{UC-ID}/` — mặc định `docs/{UC-ID}/`, cấu hình qua `paths.qc_dir`
|
|
47
|
+
> trong `project-context.yaml`. Đây là **working-doc riêng của QC** trong repo QC, **không ẩn**
|
|
48
|
+
> (KHÔNG nằm trong `.agent/`). Spec gốc (PRD/`.feature`/design-spec) KHÔNG nằm đây — chúng đến
|
|
49
|
+
> từ **submodule spec của PO** (`spec_source`). `/qc-analyze` chỉ ghi **đúng 2 file**:
|
|
50
|
+
> `REQUIREMENT_ANALYSIS.md` (phân tích gộp) + `DOC_GAPS.md`.
|
|
51
|
+
|
|
52
|
+
## Stack — Module qc-playwright
|
|
53
|
+
|
|
54
|
+
`/qc-run-test` và `/qc-report` dùng stack module `qc-playwright`
|
|
55
|
+
(`.agent/modules/qc-playwright/stack-profile.yaml`): **Python + pytest-playwright + Page
|
|
56
|
+
Object** (slim `BasePage`, 3-layer), **Playwright Trace + pytest-html** (KHÔNG Allure). Stack
|
|
57
|
+
này độc lập với module implementation của dev (java-spring, react, flutter, …).
|
|
58
|
+
|
|
59
|
+
Per-layer guides chi tiết nằm trong `skills/qc/<stage>/` (port từ skills của agent QC):
|
|
60
|
+
functional / integration / e2e / non-functional / exploratory.
|
|
61
|
+
|
|
62
|
+
## Trace Join: qc_status Đến Living Docs Như Thế Nào
|
|
63
|
+
|
|
64
|
+
1. `.feature` chính thức định nghĩa scenario là `@trace.scenario={UC-ID}-SC{N}`.
|
|
65
|
+
2. `/qc-design-test` ghi SC mà test case thuộc về; `/qc-run-test` tag mỗi pytest test
|
|
66
|
+
`# @trace.verifies={UC-ID}-SC{N}`.
|
|
67
|
+
3. `/qc-run-test` ghi `qc_status` (`pass|fail|skip|not_run`) + `qc_run_at` vào trace TSV của
|
|
68
|
+
service (authoritative), rồi refresh panel mirror local.
|
|
69
|
+
4. `/validate-traces` (hoặc `/sync`) tổng hợp các TSV thành report Living Docs tại
|
|
70
|
+
`{spec_source}/.living-docs/` — dashboard hiển thị `qc_status` cạnh `dev_selftest`.
|
|
71
|
+
|
|
72
|
+
## Entry Point
|
|
73
|
+
|
|
74
|
+
Pipeline QC bắt đầu ngay khi BDD của một UC được approved (`/review-context (BDD)` APPROVED):
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
/qc-analyze {UC-ID} → … → /qc-report {UC-ID} → /validate-traces {UC-ID}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Skills Theo Layer
|
|
81
|
+
|
|
82
|
+
Các skill chi tiết theo từng giai đoạn QC nằm trong `skills/qc/`:
|
|
83
|
+
|
|
84
|
+
| Stage skill | Vai trò |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `qa-analyst` | phân tích requirement, sinh `DOC_GAPS` |
|
|
87
|
+
| `qa-planner` | test plan, risk, questions-for-dev |
|
|
88
|
+
| `qa-designer` | thiết kế test case `.Test.md` theo layer (functional / integration / e2e / non-functional / exploratory) |
|
|
89
|
+
| `qa-reviewer` | cổng review test case và script |
|
|
90
|
+
| `qa-runner` | sinh + chạy Python pytest-playwright, sinh report (Playwright Trace + pytest-html) |
|
|
91
|
+
|
|
92
|
+
Mỗi skill **tự chứa** (self-contained) và có version frontmatter để theo dõi khi nâng cấp.
|
|
93
|
+
|
|
94
|
+
## Khi QC Tìm Thấy Bug / Spec Gap — Đẩy Lên Specs
|
|
95
|
+
|
|
96
|
+
QC chạy pipeline nhưng **không tự sửa spec/code**. Khi phát hiện vấn đề, đẩy lên spec repo của PO
|
|
97
|
+
qua flow feedback có sẵn (`/report-bug` · `/propose-scenario` — PO/Dev nhận khi `/sync`):
|
|
98
|
+
|
|
99
|
+
| QC phát hiện ở | Loại | Hành động |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| `/qc-run-test` FAIL = **product-gap** (impl ≠ spec, lỗi thật) | bug | `/report-bug {UC-ID} {expected vs actual}` |
|
|
102
|
+
| `/qc-run-test` FAIL = **script-bug** (sai selector/logic script) | — | QC tự sửa script + chạy lại (**KHÔNG** file bug) |
|
|
103
|
+
| `/qc-analyze` `DOC_GAPS` blocker = **spec sai / mơ hồ / mâu thuẫn** (PRD·BDD) | spec defect | `/report-bug {UC-ID}` (BUG_FLOW phân loại PRD/BDD) |
|
|
104
|
+
| `/qc-analyze` `DOC_GAPS` = **thiếu coverage** (behavior trong AC nhưng chưa có scenario) | coverage gap | `/propose-scenario {UC-ID}` |
|
|
105
|
+
| `DOC_GAPS` = `ASSUMPTION` / `OPEN QUESTION` | câu hỏi | qc-plan → questions-for-dev (xác nhận với PO/Dev, không file bug) |
|
|
106
|
+
|
|
107
|
+
`/report-bug` ghi `feedback/bug-reports/BUG-xxx.md` + commit/push lên spec repo; `/propose-scenario`
|
|
108
|
+
ghi `feedback/bdd-proposals/`. PO/Dev thấy khi `/sync`, rồi BUG_FLOW định tuyến root cause:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
• Code bug → Dev /fix-bug (KHÔNG đổi spec)
|
|
112
|
+
• BDD sai / thiếu → sửa .feature / promote proposal → /generate-bdd
|
|
113
|
+
• PRD mơ hồ / sai → PO sửa PRD → /refine-prd → /review-context → /generate-bdd
|
|
114
|
+
↓ (nếu spec đổi → regenerate)
|
|
115
|
+
/generate-code lại → QC /qc-run-test lại → qc_status: fail → pass
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> QC chỉ **đọc** spec (từ submodule PO) — mọi thay đổi PRD/BDD là việc của PO/Dev. QC đẩy *tín hiệu*
|
|
119
|
+
> (bug / proposal / gap), không tự sửa canonical spec. `/qc-report` ở cuối pipeline **in sẵn** danh
|
|
120
|
+
> sách lệnh `/report-bug` cho từng product-gap để QC chạy. Chi tiết flow bug: [Operations · Bug Flow](../04-operations/bug-flow.md).
|
|
121
|
+
|
|
122
|
+
## Skill Sourcing & Upgrade-Safety
|
|
123
|
+
|
|
124
|
+
Các skill QC (`qa-analyst` / `qa-designer` / `qa-planner` / `qa-reviewer` / `qa-runner` +
|
|
125
|
+
`DOC_GAPS.template.md`) **không bị hardcode** — command nạp chúng từ `paths.qc_skills_dir`:
|
|
126
|
+
|
|
127
|
+
| Tình huống | `qc_skills_dir` | Hệ quả khi `/update-framework` |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| Mặc định (standalone) | `.agent/skills/qc` (bản framework bundle) | **Bị ghi đè** mỗi lần upgrade → đừng sửa trực tiếp ở đây |
|
|
130
|
+
| QC sở hữu skill (khuyến nghị) | repo QC / submodule, vd `qc-base/.claude/skills` | **Không bao giờ bị đụng** — upgrade chỉ rewrite `.agent/` |
|
|
131
|
+
|
|
132
|
+
> `qc_skills_dir` chỉ cần trỏ tới thư mục **chứa các folder `qa-*`**. Cả 2 layout đều hợp lệ:
|
|
133
|
+
> framework bundle (`.agent/skills/qc/qa-analyst/…`) và repo QC (`.claude/skills/qa-analyst/…`).
|
|
134
|
+
|
|
135
|
+
**Cách QC tách skill ra khỏi vòng đời framework:**
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# 1. Đưa repo skill của QC vào project (submodule để pin version):
|
|
139
|
+
git submodule add <ai-automation-qc-base-repo-url> qc-base
|
|
140
|
+
|
|
141
|
+
# 2. Trỏ qc_skills_dir trong .agent/project-context.yaml:
|
|
142
|
+
# paths:
|
|
143
|
+
# qc_skills_dir: "qc-base/.claude/skills"
|
|
144
|
+
|
|
145
|
+
# 3. Từ giờ: QC hoàn thiện skill trong repo qc-base, bump submodule khi cần.
|
|
146
|
+
# /update-framework ghi đè .agent/ nhưng KHÔNG chạm qc-base/ → skill an toàn.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Nhờ vậy **vòng đời skill QC** và **vòng đời framework** tách hẳn nhau: nâng cấp framework
|
|
150
|
+
không nuốt mất skill đang hoàn thiện, và QC update skill 1 chỗ (repo của họ) cho mọi project.
|
|
151
|
+
|
|
152
|
+
## Xem Thêm
|
|
153
|
+
|
|
154
|
+
- [Guide › Tester](tester/README.md) — vai trò tester, spec-manifest, `/report-bug`, `/propose-scenario`
|
|
155
|
+
- [Concepts › Traceability](../03-concepts/traceability.md) — trace TSV, dev_selftest vs qc_status
|
|
156
|
+
- [Reference › Modules](../05-reference/modules.md) — chi tiết module `qc-playwright`
|
|
157
|
+
- [Reference › Commands](../05-reference/commands.md) — danh mục đầy đủ mọi command
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[📚 Docs](../../README.md) › [Guides](../README.md) › Tester / QA
|
|
2
|
+
|
|
3
|
+
# Hướng Dẫn Tester — Spec-Driven Dev
|
|
4
|
+
|
|
5
|
+
Tài liệu dành cho **QA / Tester** — cách kết nối với spec framework, workflow kiểm thử, và các tình huống thực tế.
|
|
6
|
+
|
|
7
|
+
## Mục Lục
|
|
8
|
+
|
|
9
|
+
| Trang | Nội dung |
|
|
10
|
+
|---|---|
|
|
11
|
+
| [Spec Manifest & Setup](spec-manifest.md) | Spec manifest là gì · setup tester agent · Living Docs panel |
|
|
12
|
+
| [Workflow](workflow.md) | Luồng làm việc cơ bản từ nhận task đến pass/fail |
|
|
13
|
+
| [Đọc Spec Chain](reading-specs.md) | Thứ tự đọc PRD → BDD → Tech Docs · ví dụ thực tế |
|
|
14
|
+
| [Tình huống thực tế](scenarios.md) | 6 scenario: feature mới, PRD thay đổi, multi-service, regression, ... |
|
|
15
|
+
| [Báo cáo bug](bug-reporting.md) | `/report-bug` · `/propose-scenario` · template báo cáo |
|
|
16
|
+
| [Checklist test pass](test-checklist.md) | Checklist trước khi báo "test pass" |
|
|
17
|
+
|
|
18
|
+
## Vai Trò Tester Trong Framework
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
PO/BA Dev Tester
|
|
22
|
+
────────── ────────────────── ──────────────────────────
|
|
23
|
+
PRD BDD (từ PRD) /sync + /generate-spec-manifest
|
|
24
|
+
Tech Docs Đọc PRD + BDD + Tech Docs
|
|
25
|
+
Code Viết test cases · Chạy test
|
|
26
|
+
▲ ▲ /report-bug (bug → spec-traced)
|
|
27
|
+
│ │ /propose-scenario (edge case → BDD draft)
|
|
28
|
+
└──────────────┴───── feedback/ trong spec repo ◄────┘
|
|
29
|
+
PO/Dev thấy qua /sync (📥) → fix / promote / update PRD
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Tester chịu trách nhiệm:**
|
|
33
|
+
- Đọc PRD để hiểu business requirement trước khi test
|
|
34
|
+
- Đọc BDD để biết chính xác scenarios cần cover
|
|
35
|
+
- Đọc Tech Docs để hiểu API contracts và data flow
|
|
36
|
+
- Viết test cases dựa trên BDD scenarios
|
|
37
|
+
- Khi bug xảy ra: `/report-bug` → tạo bug report có spec-context đầy đủ, phân loại layer
|
|
38
|
+
- Khi phát hiện edge case chưa có trong BDD: `/propose-scenario` → đề xuất cho PO/Dev duyệt
|
|
39
|
+
|
|
40
|
+
**Tester KHÔNG làm:**
|
|
41
|
+
- Sửa PRD / BDD / Tech Docs trực tiếp — đó là việc của PO và Dev
|
|
42
|
+
- Approve PRD — chỉ PO
|
|
43
|
+
- Generate code — chỉ Dev
|
|
44
|
+
|
|
45
|
+
> **Lưu ý về `/propose-scenario`:** lệnh này **không** sửa BDD. Nó chỉ ghi một bản *đề xuất* (draft Gherkin) vào vùng `feedback/bdd-proposals/` của spec repo dùng chung. PO/Dev review và đưa vào `.feature` chính thức.
|
|
46
|
+
|
|
47
|
+
## Commands Dành Cho Tester
|
|
48
|
+
|
|
49
|
+
| Command | Mục đích | Khi nào dùng |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| `/generate-spec-manifest` | Tạo index TICKET-ID → PRD/BDD/tech-doc | Trước mỗi sprint, sau khi pull specs mới |
|
|
52
|
+
| `/report-bug {UC-ID} {mô tả}` | Tạo bug report có spec-context + phân loại layer (read-only) | Khi test fail / phát hiện bug |
|
|
53
|
+
| `/propose-scenario {UC-ID} {mô tả}` | Đề xuất scenario BDD mới cho edge case chưa cover | Khi tìm thấy case ngoài BDD hiện có |
|
|
54
|
+
|
|
55
|
+
**QC Automation Pipeline (chính thức) — 6 lệnh `/qc-*`:**
|
|
56
|
+
|
|
57
|
+
| Command | Mục đích | Khi nào dùng |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `/qc-analyze` | Phân tích spec chain (PRD + BDD + Tech Docs), xác định scope test | Bước 1, sau khi BDD đã approved |
|
|
60
|
+
| `/qc-plan` | Lập test plan: liệt kê scenarios, layer, ưu tiên | Bước 2 |
|
|
61
|
+
| `/qc-design-test` | Thiết kế test case chi tiết (Page Object, data, assertions) | Bước 3 |
|
|
62
|
+
| `/qc-review` | Review test design trước khi code automation | Bước 4 |
|
|
63
|
+
| `/qc-run-test` | Chạy automation test → ghi `qc_status` per scenario vào trace TSV | Bước 5 |
|
|
64
|
+
| `/qc-report` | Tổng hợp kết quả thành QC report | Bước 6 |
|
|
65
|
+
|
|
66
|
+
Đây là **bộ test chính thức (authoritative) của QC**, chạy ngay trong framework. Pipeline dùng stack module `qc-playwright` (Python + pytest-playwright + Page Object). Xem chi tiết flow tại **[QC Automation guide](../qc-automation.md)**.
|
|
67
|
+
|
|
68
|
+
> **Artifact ra đâu:** `/qc-analyze` ghi **2 file** (`REQUIREMENT_ANALYSIS.md` + `DOC_GAPS.md`), `/qc-plan` → `TEST_PLAN.md`, `/qc-design-test` → `test-cases/*.Test.md` — tất cả trong `{qc_dir}/{UC-ID}/` (mặc định `docs/`, **visible**, không phải `.agent/` ẩn). Skill QC nạp từ `paths.qc_skills_dir` — trỏ được tới repo QC để skill **không bị `/update-framework` ghi đè**. Chi tiết: [QC Automation guide](../qc-automation.md#skill-sourcing--upgrade-safety).
|
|
69
|
+
|
|
70
|
+
> **Phân biệt với test commands của Dev:** `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` là **dev tự kiểm tra code của mình** — phát tín hiệu `dev_selftest`, KHÔNG phải bộ test chính thức. Bộ test authoritative của QC là pipeline `/qc-*` (sinh ra `qc_status`). Hai luồng tách biệt.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
*Xem thêm:* [Developer Guide](../developer/README.md) · [QC Automation Guide](../qc-automation.md) · [Operations › Bug Flow](../../04-operations/bug-flow.md) · [Reference › Commands](../../05-reference/commands.md)
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Báo cáo bug
|
|
2
|
+
|
|
3
|
+
# Khi Tìm Thấy Bug — Quy Trình Trace
|
|
4
|
+
|
|
5
|
+
Khi test fail, báo cáo phải có đủ **spec context** để Dev fix đúng chỗ.
|
|
6
|
+
|
|
7
|
+
## Cách nhanh nhất: `/report-bug`
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
/report-bug FT-001 tài khoản khoá sau 6 lần sai, spec ghi 5
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Lệnh tự động:
|
|
14
|
+
- Resolve spec-context từ `spec-manifest.yaml`: PRD path + version, BDD scenario fail, tech-doc
|
|
15
|
+
- Tìm **AC bị vi phạm** trong PRD
|
|
16
|
+
- **Phân loại layer** theo BUG_FLOW (Code / BDD / PRD / Design Spec / Env) → route đúng người
|
|
17
|
+
- Phát hiện **coverage gap** → gợi ý `/propose-scenario`
|
|
18
|
+
- Ghi report vào **spec repo** (`{spec_source}/feedback/bug-reports/{BUG-ID}.md`) → **commit + push**
|
|
19
|
+
|
|
20
|
+
Hoàn toàn **read-only** trên spec/code chính thức — chỉ ghi vào vùng `feedback/`.
|
|
21
|
+
|
|
22
|
+
> **Làm sao PO/Dev biết?** Report được commit+push vào **spec repo dùng chung**. PO/Dev chạy `/sync` hàng ngày sẽ thấy dòng `📥 New tester feedback`. File nằm local một mình thì không ai biết — chính bước push + `/sync` mới khép vòng. (Không có quyền push → tạo PR/MR.)
|
|
23
|
+
|
|
24
|
+
## Khi bug là "thiếu scenario" — `/propose-scenario`
|
|
25
|
+
|
|
26
|
+
Nếu `/report-bug` báo *coverage gap* (behavior đúng nhưng chưa có scenario nào kiểm):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
/propose-scenario FT-001 login với email có khoảng trắng ở cuối vẫn phải thành công
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- Nếu behavior **đã nằm trong một AC của PRD** → lệnh draft Gherkin (tag `@proposed @from-test`), ghi vào `{spec_source}/feedback/bdd-proposals/` → commit + push. PO/Dev review rồi đưa vào `.feature`.
|
|
33
|
+
- Nếu behavior **chưa có trong PRD** → lệnh **ghi** một *PRD change request* (`State: Open`) vào `{spec_source}/feedback/prd-change-requests/{UC-ID}-{slug}.md` → commit + push (KHÔNG chỉ in ra). PO thấy nó khi `/sync`, thêm/sửa AC rồi `/generate-bdd` lại.
|
|
34
|
+
|
|
35
|
+
> Tester không tự ghi vào BDD — chỉ đề xuất. Giữ đúng ownership.
|
|
36
|
+
|
|
37
|
+
## Template báo cáo bug
|
|
38
|
+
|
|
39
|
+
*(Tham khảo — `/report-bug` tự sinh theo format này. Dùng khi báo cáo thủ công.)*
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Bug ID : BUG-{date}-{seq}
|
|
43
|
+
Feature : FT-{xxx} — {feature name}
|
|
44
|
+
Service : BE / Web / App
|
|
45
|
+
Severity : Critical / Major / Minor
|
|
46
|
+
|
|
47
|
+
Spec context:
|
|
48
|
+
PRD : specs/prd/{domain}/{TICKET-ID}.md (v{x.x})
|
|
49
|
+
BDD : {bdd path} → Scenario: "{scenario title}"
|
|
50
|
+
Tech Doc : {tech_docs path}
|
|
51
|
+
|
|
52
|
+
AC bị vi phạm:
|
|
53
|
+
AC{N}: "{AC text từ PRD}"
|
|
54
|
+
|
|
55
|
+
BDD Scenario bị fail:
|
|
56
|
+
"{Scenario title}"
|
|
57
|
+
Given: {given state}
|
|
58
|
+
When : {action}
|
|
59
|
+
Then : {expected theo spec}
|
|
60
|
+
|
|
61
|
+
Actual behavior:
|
|
62
|
+
{what actually happened}
|
|
63
|
+
|
|
64
|
+
Steps to reproduce:
|
|
65
|
+
1. {step}
|
|
66
|
+
2. {step}
|
|
67
|
+
|
|
68
|
+
Environment: staging / production
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Ví dụ báo cáo thực tế
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Bug ID : BUG-20260605-003
|
|
75
|
+
Feature : FT-001 — User Login
|
|
76
|
+
Service : BE
|
|
77
|
+
Severity : Major
|
|
78
|
+
|
|
79
|
+
Spec context:
|
|
80
|
+
PRD : specs/prd/auth/FT-001-login.md (v1.0)
|
|
81
|
+
BDD : free-trial-be/specs/bdd/auth/FT-001-login.feature
|
|
82
|
+
→ Scenario: "Lock account after 5 failed attempts"
|
|
83
|
+
Tech Doc : free-trial-specs/specs/tech-docs/auth/FT-001-auth-api.md
|
|
84
|
+
|
|
85
|
+
AC bị vi phạm:
|
|
86
|
+
AC3: "Sai password 5 lần liên tiếp → khoá tài khoản 30 phút"
|
|
87
|
+
|
|
88
|
+
BDD Scenario bị fail:
|
|
89
|
+
"Lock account after 5 failed attempts"
|
|
90
|
+
Given : user "alice@example.com" has 0 failed attempts
|
|
91
|
+
When : login with wrong password 5 times
|
|
92
|
+
Then : 5th attempt returns 423 Locked
|
|
93
|
+
AND retry_after = 1800
|
|
94
|
+
|
|
95
|
+
Actual behavior:
|
|
96
|
+
5th attempt returns 401 Unauthorized (không phải 423)
|
|
97
|
+
Không có retry_after header
|
|
98
|
+
→ Tài khoản không bị khoá, vẫn cho thử tiếp
|
|
99
|
+
|
|
100
|
+
Steps to reproduce:
|
|
101
|
+
POST /api/v1/auth/login × 5 với password sai
|
|
102
|
+
→ lần thứ 5 vẫn nhận 401
|
|
103
|
+
|
|
104
|
+
Environment: staging (deploy 2026-06-05 09:00)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Sau khi gửi bug report
|
|
108
|
+
|
|
109
|
+
Dev sẽ xác định bug thuộc layer nào (code / BDD / PRD / env) và phản hồi với root cause + scenario cần re-test.
|
|
110
|
+
|
|
111
|
+
> Xem flow phối hợp đầy đủ giữa Tester ↔ Dev ↔ PO trong **[Operations › Bug Flow](../../04-operations/bug-flow.md)**.
|
|
112
|
+
|
|
113
|
+
> **Nếu AI lặp lại cùng kiểu lỗi qua nhiều feature:** ghi chú trong bug report. Dev chạy `/learn` để biến nó thành guardrail — AI sẽ không sinh lại lỗi đó ở các UC sau.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
← [Tình huống thực tế](scenarios.md) · Tiếp theo: [Checklist test pass](test-checklist.md)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Đọc Spec Chain
|
|
2
|
+
|
|
3
|
+
# Đọc Và Hiểu Spec Chain
|
|
4
|
+
|
|
5
|
+
## Thứ tự đọc và mục đích
|
|
6
|
+
|
|
7
|
+
| Tài liệu | Đọc để | Ví dụ thực tế |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| **PRD** | Hiểu WHAT — business requirement | "Sai password 5 lần → khoá 30 phút" |
|
|
10
|
+
| **BDD** | Biết HOW VERIFIED — exact scenarios | `Given 5 failed logins, Then 423 Locked` |
|
|
11
|
+
| **Tech Docs BE** | Biết API contract khi test BE | `POST /api/v1/auth/login`, error codes |
|
|
12
|
+
| **Tech Docs Web** | Biết UI states khi test Web | Screen names, component behaviors |
|
|
13
|
+
|
|
14
|
+
## Ví dụ đọc spec chain — FT-001 Login
|
|
15
|
+
|
|
16
|
+
Sau khi chạy `/generate-spec-manifest`, tra manifest để lấy paths:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
# spec-manifest.yaml
|
|
20
|
+
FT-001:
|
|
21
|
+
prd: "my-project-specs/specs/prd/auth/FT-001-login.md"
|
|
22
|
+
bdd:
|
|
23
|
+
be: "free-trial-be/specs/bdd/auth/system/FT-001-UC1-login-system.feature"
|
|
24
|
+
web: "free-trial-web/specs/bdd/auth/web/FT-001-UC1-login-web.feature"
|
|
25
|
+
tech_docs:
|
|
26
|
+
be: "my-project-specs/specs/tech-docs/auth/FT-001-auth-api.md"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Bước 1: Đọc PRD** tại `my-project-specs/specs/prd/auth/FT-001-login.md`
|
|
30
|
+
*(nằm trong spec submodule — shared repo của PO)*
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# AC trong PRD FT-001:
|
|
34
|
+
AC1: Đăng nhập thành công → truy cập được hệ thống
|
|
35
|
+
AC2: Sai password → hiển thị lỗi, không tiết lộ thông tin user
|
|
36
|
+
AC3: Sai password 5 lần liên tiếp → khoá tài khoản 30 phút
|
|
37
|
+
AC4: Tài khoản bị khoá → thông báo thời gian mở khoá
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Bước 2: Đọc BDD System (cho BE)** tại `free-trial-be/specs/bdd/auth/system/FT-001-UC1-login-system.feature`
|
|
41
|
+
*(nằm trong service submodule của BE — PO gen, chứa contract BE phải đáp ứng)*
|
|
42
|
+
|
|
43
|
+
```gherkin
|
|
44
|
+
Scenario: Successful login
|
|
45
|
+
Given user "alice@example.com" exists
|
|
46
|
+
When POST /api/v1/auth/login {"email": "alice@...", "password": "correct"}
|
|
47
|
+
Then status 200, body has access_token and refresh_token
|
|
48
|
+
|
|
49
|
+
Scenario: Lock after 5 failures
|
|
50
|
+
Given user has 0 failed attempts
|
|
51
|
+
When login with wrong password 5 times
|
|
52
|
+
Then 5th attempt returns 423
|
|
53
|
+
And response has retry_after: 1800
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Bước 3: Đọc Tech Docs BE** tại `my-project-specs/specs/tech-docs/auth/FT-001-auth-api.md`
|
|
57
|
+
*(nằm trong spec submodule — Dev gen, SA sign-off, đây là API contract chính thức)*
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# Auth API — Error Codes
|
|
61
|
+
401 — sai password (failed_attempts < 5)
|
|
62
|
+
423 — tài khoản bị khoá (retry_after tính bằng giây)
|
|
63
|
+
404 — email không tồn tại (không phân biệt với 401 — security)
|
|
64
|
+
|
|
65
|
+
# Headers bắt buộc
|
|
66
|
+
Authorization: Bearer {token}
|
|
67
|
+
X-Request-ID: uuid (optional, dùng để trace)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Kết quả: tester biết cần test:**
|
|
71
|
+
- `POST /auth/login` với đúng credentials → 200 + token
|
|
72
|
+
- `POST /auth/login` với sai password → 401 (message không reveal user exists/not)
|
|
73
|
+
- 5 lần sai → 423 + `retry_after: 1800`
|
|
74
|
+
- Email không tồn tại → 404 (message = 401 message — security by design)
|
|
75
|
+
- Sau 30 phút → có thể login lại
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
← [Workflow](workflow.md) · Tiếp theo: [Tình huống thực tế](scenarios.md)
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
[📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Tình huống thực tế
|
|
2
|
+
|
|
3
|
+
# Tình Huống Thực Tế
|
|
4
|
+
|
|
5
|
+
## Tình huống 1: Test feature mới được assign
|
|
6
|
+
|
|
7
|
+
**Bối cảnh:** PO thông báo FT-042 Checkout đã approved.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 1. Cập nhật repo
|
|
11
|
+
git pull && git submodule update --remote --recursive
|
|
12
|
+
|
|
13
|
+
# 2. Refresh manifest
|
|
14
|
+
/generate-spec-manifest
|
|
15
|
+
|
|
16
|
+
# 3. Kiểm tra status
|
|
17
|
+
# FT-042:
|
|
18
|
+
# status: approved ← ✅ có thể test
|
|
19
|
+
# prd: "specs/prd/payment/FT-042-checkout.md"
|
|
20
|
+
# bdd:
|
|
21
|
+
# be: "free-trial-be/specs/bdd/payment/system/FT-042-UC1-checkout-system.feature"
|
|
22
|
+
# web: "free-trial-web/specs/bdd/payment/web/FT-042-UC1-checkout-web.feature"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Test plan từ BDD BE (7 scenarios):**
|
|
26
|
+
|
|
27
|
+
| # | Scenario | Input | Expected |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| 1 | Checkout thành công | Cart đủ hàng, card valid | 201 + order_id |
|
|
30
|
+
| 2 | Cart rỗng | Không có items | 400 EMPTY_CART |
|
|
31
|
+
| 3 | Hết hàng | item_id đã sold out | 409 OUT_OF_STOCK |
|
|
32
|
+
| 4 | Card bị từ chối | card number test declined | 402 PAYMENT_DECLINED |
|
|
33
|
+
| 5 | Timeout payment gateway | mock timeout | 504 + order status PENDING |
|
|
34
|
+
| 6 | Giới hạn thanh toán | amount > 10,000,000 VND | 400 LIMIT_EXCEEDED |
|
|
35
|
+
| 7 | Session hết hạn | expired token | 401 UNAUTHORIZED |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Tình huống 2: PRD thay đổi giữa sprint
|
|
40
|
+
|
|
41
|
+
**Bối cảnh:** Đang test FT-042 thì PO update PRD v1.0 → v1.1 (giới hạn từ 5tr → 10tr).
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git pull && git submodule update --remote --recursive
|
|
45
|
+
/generate-spec-manifest
|
|
46
|
+
# spec-manifest.yaml: FT-042 prd_version: "1.1"
|
|
47
|
+
# FT-042 Changelog:
|
|
48
|
+
# v1.1 | 2026-06-05 | BR7: payment limit thay đổi 5,000,000 → 10,000,000
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Cập nhật test case:**
|
|
52
|
+
```
|
|
53
|
+
Test case 6 cũ: amount > 5,000,000 → 400 LIMIT_EXCEEDED ← STALE
|
|
54
|
+
Test case 6 mới: amount > 10,000,000 → 400 LIMIT_EXCEEDED ← theo v1.1
|
|
55
|
+
|
|
56
|
+
Thêm test case mới:
|
|
57
|
+
Test case 6b: amount = 9,999,999 → 201 OK (boundary case — giờ pass)
|
|
58
|
+
Test case 6c: amount = 10,000,001 → 400 LIMIT_EXCEEDED
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> Nếu Dev chưa update code theo v1.1 → test fail vì code vẫn dùng limit 5tr → báo Dev, không phải bug.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Tình huống 3: Test BE và Web cùng 1 feature
|
|
66
|
+
|
|
67
|
+
**Bối cảnh:** FT-001 Login có BDD cho cả BE (API) và Web (UI).
|
|
68
|
+
|
|
69
|
+
**BE test** — đọc `bdd.be` (System BDD) + `tech_docs.be`:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Endpoint: POST /api/v1/auth/login
|
|
73
|
+
Test tool: Postman / k6 / Jest supertest
|
|
74
|
+
|
|
75
|
+
Test cases từ BDD System (cho BE):
|
|
76
|
+
✅ SC1: Valid credentials → 200 + JWT
|
|
77
|
+
✅ SC2: Wrong password → 401 (message generic)
|
|
78
|
+
✅ SC3: 5 failures → 423 + retry_after
|
|
79
|
+
✅ SC4: Locked account → 423
|
|
80
|
+
✅ SC5: Email không tồn tại → 404 (message = 401 message)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Web test** — đọc `bdd.web` + `tech_docs.web`:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
Tool: Playwright
|
|
87
|
+
|
|
88
|
+
Test cases từ BDD Web:
|
|
89
|
+
✅ SC1: Điền đúng → redirect dashboard
|
|
90
|
+
✅ SC2: Sai password → toast error, password cleared
|
|
91
|
+
✅ SC3: 5 lần sai → form disabled + countdown timer
|
|
92
|
+
✅ SC4: "Quên mật khẩu?" link visible sau 3 lần sai
|
|
93
|
+
✅ SC5: Session expired → redirect về login với message
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Cross-check quan trọng:** BE trả `retry_after: 1800` → Web hiển thị countdown `29:59`. Nếu Web không đọc đúng header → bug.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Tình huống 4: Feature chưa có BDD
|
|
101
|
+
|
|
102
|
+
**Manifest báo:**
|
|
103
|
+
```
|
|
104
|
+
⚠️ 1 PRDs with no matching BDD:
|
|
105
|
+
- FT-055 (notification) — run /generate-bdd first
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Xử lý:**
|
|
109
|
+
```
|
|
110
|
+
Không tự gen BDD — đó là việc của Dev.
|
|
111
|
+
|
|
112
|
+
1. PRD có status: approved nhưng chưa có BDD → báo Dev lead
|
|
113
|
+
PRD còn draft → chờ PO approve trước
|
|
114
|
+
|
|
115
|
+
2. Nếu bị yêu cầu test mà chưa có BDD:
|
|
116
|
+
→ Test dựa trên PRD AC trực tiếp
|
|
117
|
+
→ Ghi chú rõ trong test report: "Tested against PRD AC, no BDD available"
|
|
118
|
+
→ Không thể trace chi tiết → coverage thấp hơn
|
|
119
|
+
|
|
120
|
+
3. Sau khi Dev gen BDD → refresh manifest → test lại đầy đủ
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Tình huống 5: Regression testing sau merge lớn
|
|
126
|
+
|
|
127
|
+
**Bối cảnh:** Dev merge refactor module Auth (đổi tên `AuthService` → `IdentityService`).
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
git pull && git submodule update --remote --recursive
|
|
131
|
+
/generate-spec-manifest
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Xác định scope regression từ spec-manifest:**
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
1. Domain bị ảnh hưởng: auth
|
|
138
|
+
2. Tất cả features có domain: auth:
|
|
139
|
+
- FT-001 (login), FT-003 (register), FT-007 (password reset), FT-012 (2FA)
|
|
140
|
+
|
|
141
|
+
3. Features khác có @trace.module: IdentityService:
|
|
142
|
+
→ Grep trong tech_docs: "IdentityService"
|
|
143
|
+
→ FT-019 (profile) cũng phụ thuộc vào IdentityService
|
|
144
|
+
|
|
145
|
+
Regression scope: FT-001, FT-003, FT-007, FT-012, FT-019
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Tình huống 6: Test feature multi-service (BE + Web + App)
|
|
151
|
+
|
|
152
|
+
**Bối cảnh:** FT-042 Checkout có cả BE API, Web UI, và App UI.
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
FT-042:
|
|
156
|
+
domain: payment
|
|
157
|
+
status: approved
|
|
158
|
+
bdd:
|
|
159
|
+
be: "free-trial-be/specs/bdd/payment/system/FT-042-UC1-checkout-system.feature"
|
|
160
|
+
web: "free-trial-web/specs/bdd/payment/web/FT-042-UC1-checkout-web.feature"
|
|
161
|
+
app: "free-trial-app/specs/bdd/payment/app/FT-042-UC1-checkout-app.feature"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Test strategy:**
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
Layer 1 — BE API:
|
|
168
|
+
→ Test /api/v1/checkout endpoint isolated
|
|
169
|
+
→ Tool: Postman hoặc Jest supertest
|
|
170
|
+
|
|
171
|
+
Layer 2 — Web E2E:
|
|
172
|
+
→ Tool: Playwright
|
|
173
|
+
→ Flow: Cart → Checkout page → Payment form → Order confirmation
|
|
174
|
+
|
|
175
|
+
Layer 3 — App E2E:
|
|
176
|
+
→ Tool: Maestro / Detox
|
|
177
|
+
→ Flow: Cart screen → Checkout → Payment → Success screen
|
|
178
|
+
|
|
179
|
+
Layer 4 — Cross-layer:
|
|
180
|
+
→ Web checkout → kiểm tra order trong BE database
|
|
181
|
+
→ App checkout → cùng order visible trong Web dashboard
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
← [Đọc Spec Chain](reading-specs.md) · Tiếp theo: [Báo cáo bug](bug-reporting.md)
|