spec-lite 1.5.2 → 1.7.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.
@@ -0,0 +1,155 @@
1
+ ---
2
+ id: test-exec-func-auto-{F-XXX}-{NNN}-{slug}
3
+ type: test-exec-func-auto
4
+ status: draft
5
+ method: automation
6
+ owner: "{DEV}"
7
+ feature_id: "{F-XXX}"
8
+ test_design_ref: "main/feature/{F-XXX}-{slug}/test-design.md"
9
+ alt_harness_manual: "./test-exec-func-manual.md"
10
+ platform: web
11
+ # runner theo layer pyramid — chọn cái thấp nhất khả thi cho mỗi TC
12
+ runners:
13
+ unit: "{vitest / jest}"
14
+ component: "{testing-library / @vue/test-utils}"
15
+ api: "{supertest / pytest / RestAssured}"
16
+ narrow_ui: "playwright (single-screen, khi AC buộc phải có browser)"
17
+ spec_root: "{repo-path}/tests"
18
+ referenced_by:
19
+ - conventions.md > Test Execution Artifacts > test-exec-func-auto.md
20
+ - terms/003-test-exec-buckets.md
21
+ ---
22
+
23
+ <!--
24
+ Canonical format cho .specs/test-executions/{F-XXX}-{slug}/{NNN}-{cycle-slug}/test-exec-func-auto.md.
25
+ EXECUTION layer — bản render AUTOMATION của func scope, owner DEV, kết quả = CI pass/fail.
26
+ Cover phần AUTOMATABLE của Functional (US/AC) + Validation (VR) — xem terms/003.
27
+
28
+ func là SCOPE; manual/auto là HAI HARNESS render cùng scope (manual: ./test-exec-func-manual.md).
29
+ - Team chọn harness theo kỹ năng; KHÔNG có test-exec-func-report (không đối chiếu manual ⇄ auto).
30
+ - Chỉ cover TC Autoable = YES / MAYBE. TC Autoable=NO (visual) + Exploratory KHÔNG ở đây
31
+ ⇒ auto-only KHÔNG đầy đủ: exploratory/visual vẫn phải walk tay ở func-manual — đừng tưởng auto cover hết.
32
+ - Inherit CÙNG TC-F{NNN}-{seq} từ test-design. KHÔNG tạo ID mới. Check cấp thấp DEV thêm ngoài
33
+ test-design = test code, không phải TC-F* artifact (muốn thành TC thì bổ sung vào test-design trước).
34
+
35
+ Pyramid: automate ở layer THẤP NHẤT khả thi — VR → unit/API, AC → component/integration,
36
+ leo lên narrow-UI (Playwright single-screen) chỉ khi AC buộc phải có browser. E2E journey → test-exec-e2e.
37
+
38
+ KHÔNG versioned: không template_version / migrations, ngoài scope /artifact-audit + /artifact-migrate.
39
+ Derived từ test-design.md → REGENERATE khi test-design đổi.
40
+
41
+ KHÔNG có cột "Test Result" điền tay — kết quả là CI run (pass/fail). Cột Status phản ánh trạng thái CI gần nhất.
42
+ -->
43
+
44
+ # Functional Test Specification (Automation): {Feature Name}
45
+
46
+ **Feature**: {F-XXX} | **Owner**: {owner} | **Reviewer**: {reviewer} | **Status**: {status}
47
+
48
+ ---
49
+
50
+ ## 1. Context
51
+
52
+ | **Field** | **Detail** |
53
+ |---|---|
54
+ | **Feature Summary** | {2–3 câu từ frd.md Overview} |
55
+ | **In-Scope** | TC `Autoable = YES/MAYBE` của Functional (US/AC) + Validation (VR) — verify bằng test code |
56
+ | **Out of Scope** | TC `Autoable = NO` (visual/layout/icon → manual-only) · Exploratory → `./test-exec-func-manual.md`; e2e journey → `./test-exec-e2e-manual.md`/`-auto.md`; NFR → `./test-exec-nfr.md`; DM → `./test-exec-dm.md` |
57
+ | **Source** | [test-design.md](../../../main/feature/{F-XXX}-{slug}/test-design.md) — TC IDs (Functional + Validation) + Traceability Matrix |
58
+ | **Alt harness (manual)** | [test-exec-func-manual.md](./test-exec-func-manual.md) — bản manual cùng func scope (team chọn 1; auto-only lọt exploratory/visual) |
59
+
60
+ ---
61
+
62
+ ## 2. Environment & Setup
63
+
64
+ > Mỗi TC gắn layer thấp nhất khả thi (test pyramid). Layer quyết định runner + tốc độ + chi phí.
65
+
66
+ | **Layer** | **Runner / Framework** | **Dùng cho** | **Tốc độ** |
67
+ |---|---|---|---|
68
+ | unit | {vitest/jest} | VR thuần logic, pure function | rất nhanh |
69
+ | component | {testing-library} | AC ở mức 1 component, render + interaction | nhanh |
70
+ | api | {supertest/pytest} | VR server-side, business logic qua endpoint | nhanh |
71
+ | narrow-UI | playwright (single-screen) | AC buộc phải có browser (focus/keyboard/DOM thật) | chậm hơn |
72
+
73
+ | **Field** | **Value** |
74
+ |---|---|
75
+ | Spec root | `{spec_root}` |
76
+ | Env | {test DB / in-memory / mock external} |
77
+ | Seed / fixtures | {cách provisioning tự động — factory / fixture file} |
78
+
79
+ ---
80
+
81
+ ## 3. Coverage (automatable subset)
82
+
83
+ > Mỗi `TC-F*` ở đây phải có field `Autoable = YES/MAYBE` trong test-design (source of truth) + xuất hiện ở Traceability Matrix.
84
+
85
+ ### 3.1 AC Coverage
86
+
87
+ | **AC ID** | **Priority** | **Covered by TC IDs** | **Layer** | **Notes** |
88
+ |---|---|---|---|---|
89
+ | `AC-F{NNN}-001` | 🔴 P0 | `TC-F{NNN}-001` | component | |
90
+ | `AC-F{NNN}-002` | 🟡 P1 | `TC-F{NNN}-003` | api | |
91
+
92
+ ### 3.2 VR Coverage
93
+
94
+ | **VR ID** | **Priority** | **Covered by TC IDs** | **Layer** | **Notes** |
95
+ |---|---|---|---|---|
96
+ | `VR-F{NNN}-001` | 🔴 P0 | `TC-F{NNN}-010`, `TC-F{NNN}-011`, `TC-F{NNN}-012` | unit | pos + 2 neg |
97
+
98
+ ---
99
+
100
+ ## 4. Test Cases
101
+
102
+ > **TC ID:** inherit từ `test-design.md` (chỉ Autoable=YES/MAYBE). KHÔNG tạo ID mới.
103
+ >
104
+ > **Layer:** `unit` | `component` | `api` | `narrow-UI`
105
+ >
106
+ > **Test File:** đường dẫn file code + tên test (`describe > it`). DEV điền khi implement.
107
+ >
108
+ > **Assertion:** mô tả ngắn cách verify (input → expected), ánh xạ assertion của runner.
109
+ >
110
+ > **Status (CI):** `—` (chưa viết) | `🟢 green` | `🔴 red` | `⏭ skipped` | `🟡 flaky`. **Không phải kết quả điền tay** — phản ánh CI run gần nhất.
111
+
112
+ | **TC ID** | **Covers** | **Layer** | **Test File (`describe > it`)** | **Assertion (input → expected)** | **Status (CI)** | **Priority** |
113
+ |---|---|---|---|---|---|---|
114
+ | `TC-F{NNN}-001` | `AC-F{NNN}-001` | component | `{path}/{file}.spec.ts > {describe} > {it}` | render {component} với {props} → {expected DOM/behavior} | — | 🔴 P0 |
115
+ | `TC-F{NNN}-010` | `VR-F{NNN}-001` | unit | `{path}/{validator}.spec.ts > {it}` | `validate("{valid}")` → pass | — | 🔴 P0 |
116
+ | `TC-F{NNN}-011` | `VR-F{NNN}-001` | unit | `{path}/{validator}.spec.ts > {it}` | `validate("")` → reject(required) | — | 🔴 P0 |
117
+
118
+ ---
119
+
120
+ ## 5. Fixtures & Test Data
121
+
122
+ > Provisioning tự động — factory/builder/fixture. KHÔNG login tay, KHÔNG seed thủ công.
123
+
124
+ | **Fixture / Factory** | **Type** | **Tạo gì** | **Used by (TC)** |
125
+ |---|---|---|---|
126
+ | `{userFactory}` | factory | user hợp lệ đủ field | `TC-F{NNN}-001` |
127
+ | `{boundaryInputs}` | fixture | giá trị biên cho mỗi VR | `TC-F{NNN}-010..012` |
128
+
129
+ ---
130
+
131
+ ## 6. Execution
132
+
133
+ **Commands:**
134
+
135
+ ```bash
136
+ {npm test} {path} # full func suite
137
+ {npm test} -- --grep "VR-F{NNN}-001" # theo TC/VR
138
+ {npm run test:coverage} # coverage report
139
+ ```
140
+
141
+ **CI Gate:**
142
+
143
+ | **Trigger** | **Scope** | **Gate** |
144
+ |---|---|---|
145
+ | PR → develop | func suite (P0) | block merge nếu red |
146
+ | Merge → develop | full func suite | alert nếu red |
147
+ | Nightly | full + coverage | report |
148
+
149
+ ---
150
+
151
+ ## 7. Change Log
152
+
153
+ | **Date** | **Cycle** | **Changes** | **Author** |
154
+ |---|---|---|---|
155
+ | {YYYY-MM-DD} | {cycle/release} | Initial automation spec (derive từ test-design.md, Autoable subset) | {Author} |
@@ -0,0 +1,203 @@
1
+ ---
2
+ id: test-exec-func-manual-{F-XXX}-{NNN}-{slug}
3
+ type: test-exec-func-manual
4
+ status: draft
5
+ method: manual
6
+ owner: "{QC}"
7
+ feature_id: "{F-XXX}"
8
+ test_design_ref: "main/feature/{F-XXX}-{slug}/test-design.md"
9
+ alt_harness_auto: "./test-exec-func-auto.md"
10
+ platform: web
11
+ covers: [functional, validation]
12
+ referenced_by:
13
+ - conventions.md > Test Execution Artifacts > test-exec-func-manual.md
14
+ - terms/003-test-exec-buckets.md
15
+ ---
16
+
17
+ <!--
18
+ Canonical format cho .specs/test-executions/{F-XXX}-{slug}/{NNN}-{cycle-slug}/test-exec-func-manual.md.
19
+ EXECUTION layer — bản render MANUAL của func scope, harness "GUI walk / gõ input thủ công", owner QC.
20
+ Cover Functional (US/AC) + Validation (VR) — xem terms/003-test-exec-buckets.md.
21
+
22
+ func là SCOPE; manual/auto là HAI HARNESS render cùng scope (auto: ./test-exec-func-auto.md).
23
+ - Team chọn harness theo kỹ năng; KHÔNG có test-exec-func-report (không đối chiếu manual ⇄ auto).
24
+ - KHÁC e2e: manual & auto func KHÔNG thay thế nhau hoàn toàn. Manual cover TOÀN BỘ scriptable TC
25
+ (bất kể Autoable) + TC Autoable=NO (visual) + Exploratory → manual-only ĐẦY ĐỦ.
26
+ Auto chỉ cover Autoable=YES/MAYBE → auto-only LỌT exploratory/visual.
27
+ - Inherit CÙNG TC-F{NNN}-{seq} từ test-design (xem cột Autoable). Chạy cả hai thì hai bản chỉ
28
+ cùng tồn tại — không có artifact join.
29
+
30
+ KHÔNG versioned: không template_version / migrations, ngoài scope /artifact-audit + /artifact-migrate.
31
+ Derived từ test-design.md → test-design đổi thì REGENERATE, không migrate.
32
+
33
+ Source of truth: test-design.md.
34
+ - TC IDs khớp 100% với test-design.md (section Functional + Validation Test Cases).
35
+ - KHÔNG tạo ID mới — chỉ inherit TC-F{NNN}-{seq} (stable, không renumber).
36
+ - Coverage master = test-design.md > Traceability Matrix (không tự dựng matrix cạnh tranh).
37
+ NFR → ./test-exec-nfr.md · DM → ./test-exec-dm.md · FAC e2e → ./test-exec-e2e-manual.md / -auto.md.
38
+
39
+ Test Result column là nơi DUY NHẤT QC cập nhật trạng thái thực thi (manual).
40
+ -->
41
+
42
+ # Functional Test Specification (Manual): {Feature Name}
43
+
44
+ **Feature**: {F-XXX} | **Owner**: {owner} | **Reviewer**: {reviewer} | **Status**: {status}
45
+
46
+ ---
47
+
48
+ ## 1. Context
49
+
50
+ | **Field** | **Detail** |
51
+ |---|---|
52
+ | **Feature Summary** | {2–3 câu từ frd.md Overview} |
53
+ | **In-Scope** | GUI interaction, form validation, business logic outcome, error message, permission check (functional authz), kết quả integration quan sát được trên UI |
54
+ | **Out of Scope** | NFR (perf/a11y/security scan/browser) → `./test-exec-nfr.md`; Data & Migration → `./test-exec-dm.md`; e2e business-flow (FAC) → `./test-exec-e2e-manual.md` / `-auto.md` |
55
+ | **Dependencies** | **Upstream Features:** {Feature IDs → feature này, hoặc "—"} |
56
+ | | **Seed Data:** {data phải tồn tại trước khi test — role, record, setting} |
57
+ | | **Env Config:** {feature flag, mock/real API, setting cần bật} |
58
+ | | **Known Blockers:** {bug / env issue ảnh hưởng test — "—" nếu không có} |
59
+ | **Source** | [test-design.md](../../../main/feature/{F-XXX}-{slug}/test-design.md) — source of TC IDs + Traceability Matrix |
60
+
61
+ ---
62
+
63
+ ## 2. Environment & Setup
64
+
65
+ ### 2.1 Execution Environment Matrix
66
+
67
+ | **Platform / View** | **OS** | **Browser / Viewport** | **Priority** | **Tool** |
68
+ |---|---|---|---|---|
69
+ | Web Desktop | {OS} | {browser} / 1440px | P0 | Manual |
70
+ | Web Tablet | {OS} | {browser} / 768px | P1 | Manual |
71
+ | Web Mobile | {OS} | {browser} / 375px | P1 | Manual |
72
+
73
+ ### 2.2 Environment Tiers
74
+
75
+ | **Env** | **Mục đích** | **Data Source** | **Ghi chú** |
76
+ |---|---|---|---|
77
+ | dev | Functional test (local/dev) | Seeded DB | Môi trường chính |
78
+ | stag | UAT / integration | Anonymized prod data | Khi cần kiểm tra tích hợp |
79
+
80
+ ### 2.3 Test Account & Role Matrix
81
+
82
+ > **Xóa section này nếu feature không yêu cầu authentication.**
83
+
84
+ | **Role** | **Username** | **Password** | **Access Level** | **Notes** |
85
+ |---|---|---|---|---|
86
+ | {Admin} | {admin@test} | {TBD} | Full | {ghi chú} |
87
+ | {Standard User} | {user@test} | {TBD} | Limited | {ghi chú} |
88
+ | {Guest} | — | — | None | Không xác thực |
89
+
90
+ ---
91
+
92
+ ## 3. Coverage
93
+
94
+ > Planning only — không có cột Status ở đây. Execution result track ở §4 cột `Test Result`.
95
+ > Mọi ID dưới đây phải xuất hiện trong `test-design.md > Traceability Matrix`.
96
+
97
+ ### 3.1 Acceptance Criteria Coverage
98
+
99
+ | **AC ID** | **Priority** | **Acceptance Criteria (G/W/T)** | **Covered by TC IDs** | **Coverage** | **Notes** |
100
+ |---|---|---|---|---|---|
101
+ | `AC-F{NNN}-001` | 🔴 P0 | Given … When … Then … | `TC-F{NNN}-001`, `TC-F{NNN}-002` | 2 TCs | |
102
+ | `AC-F{NNN}-002` | 🟡 P1 | Given … When … Then … | `TC-F{NNN}-003` | 1 TC | |
103
+
104
+ **AC Coverage Summary:** {N} ACs · {N} covered · 0 not covered · {N} TCs
105
+
106
+ ### 3.2 Verification Rule Coverage
107
+
108
+ > `VR-F*` từ frd.md — mỗi VR ≥ 1 positive + 1 negative per nhánh fail.
109
+
110
+ | **VR ID** | **Priority** | **Rule (short)** | **Covered by TC IDs** | **Coverage** | **Notes** |
111
+ |---|---|---|---|---|---|
112
+ | `VR-F{NNN}-001` | 🔴 P0 | {rule ngắn} | `TC-F{NNN}-010`, `TC-F{NNN}-011`, `TC-F{NNN}-012` | 3 TCs | pos + 2 neg |
113
+ | `VR-F{NNN}-002` | 🟡 P1 | {rule ngắn} | `TC-F{NNN}-013`, `TC-F{NNN}-014` | 2 TCs | pos + neg |
114
+
115
+ **VR Coverage Summary:** {N} VRs · {N} covered · 0 not covered · {N} validation TCs
116
+
117
+ ---
118
+
119
+ ## 4. Test Cases
120
+
121
+ > **TC ID:** inherit từ `test-design.md` — format `TC-F{NNN}-{seq}`, stable, không tái sử dụng seq đã xóa. KHÔNG tạo ID mới.
122
+ >
123
+ > **Test Type:** `HP` (Happy Path) | `EP` (Equivalence Partition) | `BVA` (Boundary Value Analysis) | `DT` (Decision Table) | `ST` (State Transition) | `Neg` (Negative/Guard) | `EG` (Error Guessing) | `UC` (Use Case — alt/exc flow) | `Val` (Validation — derive từ VR)
124
+ >
125
+ > **Priority:** `🔴 P0` (Critical — block nếu fail) | `🟡 P1` (High) | `🟢 P2` (Medium)
126
+ >
127
+ > **Autoable:** **inherit từ `test-design.md`** (field per-TC, source of truth) — `YES/MAYBE` = func-auto cũng cover; `NO` = visual, manual-only. KHÔNG tự phân loại ở đây.
128
+ >
129
+ > **Execution Locators:** SE điền khi automation — vd `data-testid="upload-btn"`. Để `_Pending — SE_` cho tới phase automation.
130
+ >
131
+ > **Test Data `[tag]`:** `[valid]` · `[invalid]` · `[boundary]` · `[empty]` · `[special]` · `[existing]`
132
+ >
133
+ > **Test Result:** `—` (chưa chạy) | `✅ Pass` | `❌ Fail` | `⛔ Blocked` | `🔴 HOLD` | `N/A`
134
+ >
135
+ > **Pre-Condition** (pipe `|` — `Depends` luôn đứng đầu nếu TC này cần TC khác pass trước):
136
+ > `Depends: TC-F{NNN}-001` | `Page: {name} ({/path})` | `Role: {role}` | `State: {DB state}` | `Viewport: 375|768|1440px`
137
+ >
138
+ > **Execution order** → xem §6.2.
139
+
140
+ | **TC ID** | **Type** | **Description** | **Pre-Condition** | **Steps** | **Test Data** | **Execution Locators** | **Expected Result** | **Test Result** | **Priority** | **Autoable** | **Covers** |
141
+ |---|---|---|---|---|---|---|---|---|---|---|---|
142
+ | `TC-F{NNN}-001` | HP | {verb-first} | Page: {name} ({path}) \| Role: {role} \| State: {state} | 1. {action}<br>2. {action}<br>— Verify: {outcome}<br>— Teardown: {cleanup} | {field}: "{value}" [{tag}] | _Pending — SE_ | • {outcome 1}<br>• {outcome 2} | — | 🔴 P0 | YES | `AC-F{NNN}-001` |
143
+ | `TC-F{NNN}-002` | Neg | {negative case} | Page: {name} ({path}) \| Role: {role} | 1. {action}<br>— Verify: {error} | {field}: "{invalid}" [{tag}] | _Pending — SE_ | • {error message}<br>• Form không submit | — | 🟡 P1 | YES | `AC-F{NNN}-001` |
144
+ | `TC-F{NNN}-010` | Val | {validation case — derive từ VR} | Page: {name} ({path}) | 1. Nhập `{field}` = {value}<br>— Verify: {accept/reject} | {field}: "{value}" [{tag}] | _Pending — SE_ | • {reject — lý do} | — | 🔴 P0 | YES | `VR-F{NNN}-001` |
145
+
146
+ ---
147
+
148
+ ### 4.E Exploratory Testing Checklist
149
+
150
+ > **Scope:** Manual GUI/UX exploratory — visual, responsive, accessibility quan sát, user interaction.
151
+ > **Không trong scope:** backend logic, server error, network, session (dùng test-exec-e2e/API test).
152
+ > **Budget:** 10–15% tổng thời gian manual testing.
153
+ > **Record:** phát hiện issue → ghi vào ET Findings với severity (🔴 Critical | 🟡 High | 🟢 Medium | ◯ Low).
154
+
155
+ **Visual & Layout:** Colors/fonts/spacing khớp design · button alignment/text overflow · icon render đúng · whitespace cân đối
156
+ **Responsive:** resize tablet/mobile · device thật/emulation · virtual keyboard không che field · landscape không vỡ
157
+ **Navigation:** main flow happy path · skip optional step · browser back · direct URL guard
158
+ **Accessibility:** contrast WCAG AA · font size đọc được · focus indicator (Tab) · color-blind mode
159
+ **Form Feedback:** paste ký tự đặc biệt · text rất dài wrap/truncate · Tab/Enter navigation · validation message đúng vị trí · success message rõ
160
+ **Loading:** spinner khi async · không che element · không stuck
161
+
162
+ **ET Findings Record:**
163
+
164
+ | **Area** | **Issue** | **Severity** | **Steps to Reproduce** | **Reactive TC Created?** |
165
+ |---|---|---|---|---|
166
+ | | | | | |
167
+
168
+ **ET Summary:** Time: ___ min · Findings: ___ (C/H/M/L) · New TCs: ___ · Status: ☐ Completed ☐ In Progress ☐ Deferred ☐ Not Performed
169
+
170
+ ---
171
+
172
+ ## 5. Fixtures & Test Data
173
+
174
+ > Manual không có factory tự động — data chuẩn bị bằng seed/tay trước khi chạy. Account/role xem §2.3, dependencies & seed xem §1.
175
+
176
+ | **Data-set** | **Type** | **Tạo gì** | **Used by (TC)** |
177
+ |---|---|---|---|
178
+ | `{seedUsers}` | seed | user mẫu đủ role | `TC-F{NNN}-001` |
179
+ | `{boundaryInputs}` | manual | giá trị biên nhập tay cho mỗi VR | `TC-F{NNN}-010..012` |
180
+
181
+ ---
182
+
183
+ ## 6. Execution
184
+
185
+ ### 6.1 Entry & Exit Criteria
186
+
187
+ | | Criteria |
188
+ |---|---|
189
+ | **Entry** *(bắt đầu test khi)* | frd.md approved · test-design.md exists · dev env running · seed data ready · test account configured |
190
+ | **Exit** *(done khi)* | Mọi P0 TC pass · P1 pass rate ≥ 70% · không open Critical bug · Test Result column updated đầy đủ |
191
+ | **Suspend** *(tạm dừng nếu)* | Bất kỳ P0 TC blocked · environment down · >30% P1 fail |
192
+
193
+ ### 6.2 Execution Order
194
+
195
+ > P0 → P1 → P2. Bất kỳ P0 fail → STOP. >30% P1 fail → STOP.
196
+
197
+ ---
198
+
199
+ ## 7. Change Log
200
+
201
+ | **Date** | **Cycle** | **Changes** | **Author** |
202
+ |---|---|---|---|
203
+ | {YYYY-MM-DD} | {cycle/release} | Initial functional test spec (derive từ test-design.md) | {Author} |
@@ -0,0 +1,88 @@
1
+ ---
2
+ id: test-exec-nfr-{F-XXX}-{NNN}-{slug}
3
+ type: test-exec-nfr
4
+ status: draft
5
+ owner: "{SDET / specialist}"
6
+ feature_id: "{F-XXX}"
7
+ test_design_ref: "main/feature/{F-XXX}-{slug}/test-design.md"
8
+ referenced_by:
9
+ - conventions.md > Test Execution Artifacts > test-exec-nfr.md
10
+ - terms/003-test-exec-buckets.md
11
+ ---
12
+
13
+ <!--
14
+ Canonical format cho .specs/test-executions/{F-XXX}-{slug}/{NNN}-{cycle-slug}/test-exec-nfr.md.
15
+ EXECUTION layer — ephemeral per test cycle, harness "tool đặc thù" (k6/JMeter/axe/Lighthouse/ZAP), owner SDET/specialist.
16
+ Cover Non-Functional Requirements (NFR) — perf / a11y / security / browser / i18n. Xem terms/003.
17
+
18
+ KHÔNG versioned: không template_version / migrations, ngoài scope /artifact-audit + /artifact-migrate.
19
+ Derived từ test-design.md → test-design đổi thì REGENERATE.
20
+
21
+ CHỈ TẠO file này khi frd.md có `NFR-F*` (test-design § Non-Functional Test Cases không rỗng).
22
+ Feature không có NFR riêng → KHÔNG tạo test-exec-nfr.md.
23
+
24
+ Source of truth: test-design.md > Non-Functional Test Cases.
25
+ - ID = TC-F{NNN}-{seq} inherit từ test-design (Covers NFR-F*). KHÔNG tạo ID mới.
26
+ - Coverage master = test-design.md > Traceability Matrix.
27
+
28
+ Doc này gọn — WHAT (threshold/expected) đã ở test-design; đây thêm HOW (tool + command + env).
29
+ -->
30
+
31
+ # NFR Test Execution: {Feature Name}
32
+
33
+ **Feature**: {F-XXX} | **Owner**: {owner} | **Status**: {status}
34
+
35
+ ---
36
+
37
+ ## 1. Context
38
+
39
+ | **Field** | **Detail** |
40
+ |---|---|
41
+ | **Feature Summary** | {1–2 câu — NFR scope của feature} |
42
+ | **NFR covered** | {NFR IDs — `NFR-F{NNN}-001`, ...} |
43
+ | **Source** | [test-design.md](../../../main/feature/{F-XXX}-{slug}/test-design.md) — TC IDs (Non-Functional Test Cases) + Traceability Matrix |
44
+ | **Out of Scope** | Functional security (authz) → test-exec-func · functional behavior → test-exec-func/test-exec-e2e |
45
+
46
+ ---
47
+
48
+ ## 2. Tooling & Environment
49
+
50
+ > Mỗi NFR Type cần harness riêng. Env phải tách khỏi functional test (load/scan ảnh hưởng môi trường).
51
+
52
+ | **NFR Type** | **Tool** | **Env Requirement** | **Notes** |
53
+ |---|---|---|---|
54
+ | performance | k6 / JMeter | env perf-test · dataset baseline đã load | isolated, không share với functional run |
55
+ | a11y | axe-playwright / Lighthouse | env app thường | audit per page |
56
+ | security scan | OWASP ZAP / scanner | env staging-like | baseline scan, không phá data |
57
+ | browser compat | Playwright multi-project | — | chromium / firefox / webkit |
58
+
59
+ ---
60
+
61
+ ## 3. NFR Execution
62
+
63
+ > **Input:** test-design.md § Non-Functional Test Cases (TC ID, threshold, expected).
64
+ > **Test Result:** `—` (chưa chạy) | `✅ Pass` | `❌ Fail` | `⛔ Blocked` | `🔴 HOLD`
65
+
66
+ | **TC ID** | **Covers** | **NFR Type** | **Tool** | **Execution Command / Config** | **Threshold** | **Test Result** | **Priority** |
67
+ |---|---|---|---|---|---|---|---|
68
+ | `TC-F{NNN}-050` | `NFR-F{NNN}-001` | performance | k6 | `k6 run {script}.js --vus 100 --duration 5m` | p95 ≤ 500ms · error ≤ 0.1% | — | 🔴 P0 |
69
+ | `TC-F{NNN}-051` | `NFR-F{NNN}-002` | a11y | axe-playwright | `npx playwright test --grep "a11y"` | WCAG AA · 0 critical | — | 🟡 P1 |
70
+ | `TC-F{NNN}-052` | `NFR-F{NNN}-003` | security scan | OWASP ZAP | `zap-baseline.py -t {base_url}` | 0 High · 0 Medium | — | 🔴 P0 |
71
+ | `TC-F{NNN}-053` | `NFR-F{NNN}-004` | browser compat | Playwright | `npx playwright test --project=chromium,firefox,webkit` | pass Chrome/FF/Safari | — | 🟢 P2 |
72
+
73
+ ---
74
+
75
+ ## 4. Exit Criteria
76
+
77
+ - [ ] Mọi NFR P0 TC pass (threshold đạt)
78
+ - [ ] NFR P1 không có regression so với baseline trước
79
+ - [ ] Test Result column updated đầy đủ
80
+ - [ ] Finding (nếu fail) đã raise + link bug ticket
81
+
82
+ ---
83
+
84
+ ## 5. Change Log
85
+
86
+ | **Date** | **Cycle** | **Changes** | **Author** |
87
+ |---|---|---|---|
88
+ | {YYYY-MM-DD} | {cycle/release} | Initial NFR execution (derive từ test-design.md) | {Author} |