universal-dev-standards 5.15.1 → 5.17.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/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
- package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
- package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +1 -1
- package/bundled/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/core/forward-derivation-standards.md +19 -0
- package/bundled/core/knowledge-graph-memory.md +2 -2
- package/bundled/core/spec-driven-development.md +21 -3
- package/bundled/locales/zh-CN/CHANGELOG.md +23 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
- package/bundled/locales/zh-CN/core/spec-driven-development.md +16 -2
- package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
- package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
- package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
- package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
- package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
- package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
- package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
- package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
- package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
- package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
- package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
- package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
- package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
- package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
- package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
- package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
- package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
- package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
- package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
- package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
- package/bundled/locales/zh-TW/CHANGELOG.md +23 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
- package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
- package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -2
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
- package/bundled/locales/zh-TW/core/spec-driven-development.md +20 -2
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
- package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
- package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +5 -5
- package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
- package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +3 -2
- package/bundled/locales/zh-TW/skills/plan/SKILL.md +3 -2
- package/bundled/locales/zh-TW/skills/push/SKILL.md +3 -2
- package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
- package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
- package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
- package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
- package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
- package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
- package/bundled/skills/brainstorm-assistant/guide.md +256 -661
- package/bundled/skills/commands/brainstorm.md +51 -30
- package/bundled/skills/knowledge-graph/SKILL.md +5 -5
- package/bundled/skills/knowledge-graph/guide.md +4 -4
- package/bundled/skills/spec-driven-dev/SKILL.md +27 -0
- package/package.json +2 -2
- package/src/commands/check.js +11 -2
- package/src/lint/i18n.js +109 -23
- package/standards-registry.json +4 -4
- package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
|
@@ -2,49 +2,73 @@
|
|
|
2
2
|
source: ../../../../skills/testing-guide/SKILL.md
|
|
3
3
|
source_version: 1.2.0
|
|
4
4
|
translation_version: 1.2.0
|
|
5
|
-
last_synced: 2026-02
|
|
5
|
+
last_synced: 2026-06-02
|
|
6
|
+
source_hash: 49b6f9e0c6a4
|
|
6
7
|
status: current
|
|
7
8
|
name: testing
|
|
8
9
|
description: |
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
面向 UT/IT/ST/E2E 的测试金字塔与测试编写标准。
|
|
11
|
+
支持 ISTQB 与业界通行金字塔两种框架。
|
|
12
|
+
使用时机:编写测试、讨论测试覆盖率、测试策略或测试命名时。
|
|
13
|
+
关键词:test, unit, integration, e2e, coverage, mock, ISTQB, SIT, 测试, 单元, 集成, 端对端。
|
|
13
14
|
---
|
|
14
15
|
|
|
15
16
|
# 测试指南
|
|
16
17
|
|
|
17
18
|
> **语言**: [English](../../../../skills/testing-guide/SKILL.md) | 简体中文
|
|
18
19
|
|
|
19
|
-
**版本**: 1.
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
**版本**: 1.2.0
|
|
21
|
+
**最后更新**: 2026-01-29
|
|
22
|
+
**适用范围**: Claude Code Skills
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
26
|
## 目的
|
|
26
27
|
|
|
27
|
-
本 Skill
|
|
28
|
+
本 Skill 提供测试金字塔标准和系统化测试的最佳实践,同时支持 ISTQB 与业界通行金字塔两种框架。
|
|
29
|
+
|
|
30
|
+
## 测试技能导航 | Testing Skills Navigator
|
|
31
|
+
|
|
32
|
+
UDS 提供 6 个与测试相关的 Skill。使用以下决策树找到合适的那一个:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
你想做什么? | What do you want to do?
|
|
36
|
+
├── 测量代码覆盖率(行/分支/函数) → /coverage
|
|
37
|
+
├── 追踪哪些需求已有测试(AC 可追溯性) → /ac-coverage
|
|
38
|
+
├── 以测试驱动开发进行(红-绿-重构) → /tdd
|
|
39
|
+
├── 编写 BDD 场景(Given-When-Then) → /bdd
|
|
40
|
+
├── 与利益相关者定义验收测试 → /atdd
|
|
41
|
+
└── 学习测试标准与最佳实践 → /testing(本 Skill)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Skill | 焦点 | Focus |
|
|
45
|
+
|-------|------|-------|
|
|
46
|
+
| `/testing` | 测试标准与最佳实践参考 | Standards and best practices reference |
|
|
47
|
+
| `/coverage` | 代码层级覆盖率分析 | Code-level coverage analysis |
|
|
48
|
+
| `/ac-coverage` | 需求层级 AC 可追溯性 | Requirement-level AC traceability |
|
|
49
|
+
| `/tdd` | 红-绿-重构开发循环 | Red-Green-Refactor development cycle |
|
|
50
|
+
| `/bdd` | Given-When-Then 行为场景 | Behavior scenarios with Given-When-Then |
|
|
51
|
+
| `/atdd` | 与利益相关者定义验收条件 | Acceptance criteria with stakeholders |
|
|
28
52
|
|
|
29
53
|
## 框架选择
|
|
30
54
|
|
|
31
|
-
| 框架 | 层级 |
|
|
55
|
+
| 框架 | 层级 | 适用场景 |
|
|
32
56
|
|-----------|--------|----------|
|
|
33
|
-
| **ISTQB** | UT → IT/SIT → ST → AT/UAT |
|
|
57
|
+
| **ISTQB** | UT → IT/SIT → ST → AT/UAT | 企业级、合规性、正式 QA |
|
|
34
58
|
| **业界通行金字塔** | UT (70%) → IT (20%) → E2E (10%) | 敏捷、DevOps、CI/CD |
|
|
35
59
|
|
|
36
|
-
|
|
37
|
-
- **IT** (Integration Testing):敏捷/DevOps
|
|
38
|
-
- **SIT** (System Integration Testing):企业/ISTQB
|
|
39
|
-
-
|
|
60
|
+
**集成测试缩写说明:**
|
|
61
|
+
- **IT** (Integration Testing):敏捷/DevOps 社区常用
|
|
62
|
+
- **SIT** (System Integration Testing):企业/ISTQB 环境常用
|
|
63
|
+
- 两者指的是相同的测试层级
|
|
40
64
|
|
|
41
|
-
##
|
|
65
|
+
## 快速参考
|
|
42
66
|
|
|
43
67
|
### 测试金字塔(业界标准)
|
|
44
68
|
|
|
45
69
|
```
|
|
46
70
|
┌─────────┐
|
|
47
|
-
│ E2E │ ← 10
|
|
71
|
+
│ E2E │ ← 10%(较少、较慢)
|
|
48
72
|
─┴─────────┴─
|
|
49
73
|
┌─────────────┐
|
|
50
74
|
│ IT/SIT │ ← 20%(集成测试)
|
|
@@ -54,33 +78,36 @@ description: |
|
|
|
54
78
|
└─────────────────┘
|
|
55
79
|
```
|
|
56
80
|
|
|
57
|
-
###
|
|
81
|
+
### 测试层级概览
|
|
58
82
|
|
|
59
|
-
| 层级 |
|
|
83
|
+
| 层级 | 范围 | 速度 | 依赖 |
|
|
60
84
|
|-------|-------|-------|-------------|
|
|
61
|
-
| **UT** |
|
|
62
|
-
| **IT/SIT** |
|
|
63
|
-
| **ST** | 完整系统(ISTQB) |
|
|
64
|
-
| **E2E** |
|
|
65
|
-
| **AT/UAT** | 业务验证(ISTQB) | 视情况 |
|
|
85
|
+
| **UT** | 单一函数/类 | < 100ms | Mock |
|
|
86
|
+
| **IT/SIT** | 组件交互 | 1-10秒 | 真实数据库(容器化) |
|
|
87
|
+
| **ST** | 完整系统(ISTQB) | 分钟级 | 类生产环境 |
|
|
88
|
+
| **E2E** | 用户旅程 | 30秒+ | 一切均为真实 |
|
|
89
|
+
| **AT/UAT** | 业务验证(ISTQB) | 视情况 | 一切均为真实 |
|
|
66
90
|
|
|
67
|
-
###
|
|
91
|
+
### 覆盖率目标
|
|
68
92
|
|
|
69
|
-
|
|
|
93
|
+
| 指标 | 最低要求 | 建议值 |
|
|
70
94
|
|--------|---------|-------------|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
95
|
+
| 行覆盖率 | 70% | 85% |
|
|
96
|
+
| 分支覆盖率 | 60% | 80% |
|
|
97
|
+
| 函数覆盖率 | 80% | 90% |
|
|
74
98
|
|
|
75
99
|
## 详细指南
|
|
76
100
|
|
|
77
|
-
|
|
78
|
-
- [
|
|
101
|
+
完整标准请参考:
|
|
102
|
+
- [测试标准](../../core/testing-standards.md) - 可执行的规则
|
|
103
|
+
- [测试理论](./testing-theory.md) - 教学型知识库
|
|
104
|
+
- [测试金字塔](./testing-pyramid.md) - 详细的金字塔比例
|
|
105
|
+
- [测试骨架模板](./test-skeleton-templates.md) - 面向 UT/IT/ST/Perf/Contract 的多语言骨架
|
|
79
106
|
|
|
80
|
-
### AI
|
|
107
|
+
### AI 优化格式(Token 高效)
|
|
81
108
|
|
|
82
|
-
供 AI
|
|
83
|
-
-
|
|
109
|
+
供 AI 助理使用,请采用 YAML 格式文件以减少 Token 用量:
|
|
110
|
+
- 基础标准:`ai/standards/testing.ai.yaml`
|
|
84
111
|
- 框架选项:
|
|
85
112
|
- ISTQB 框架:`ai/options/testing/istqb-framework.ai.yaml`
|
|
86
113
|
- 业界通行金字塔:`ai/options/testing/industry-pyramid.ai.yaml`
|
|
@@ -89,8 +116,12 @@ description: |
|
|
|
89
116
|
- 集成测试:`ai/options/testing/integration-testing.ai.yaml`
|
|
90
117
|
- 系统测试:`ai/options/testing/system-testing.ai.yaml`
|
|
91
118
|
- E2E 测试:`ai/options/testing/e2e-testing.ai.yaml`
|
|
119
|
+
- 安全测试:`ai/options/testing/security-testing.ai.yaml`
|
|
120
|
+
- 性能测试:`ai/options/testing/performance-testing.ai.yaml`
|
|
121
|
+
- 契约测试:`ai/options/testing/contract-testing.ai.yaml`
|
|
122
|
+
- 骨架模板(涵盖所有层级、多语言):[test-skeleton-templates.md](./test-skeleton-templates.md)
|
|
92
123
|
|
|
93
|
-
##
|
|
124
|
+
## 命名惯例
|
|
94
125
|
|
|
95
126
|
### 文件命名
|
|
96
127
|
|
|
@@ -113,70 +144,159 @@ test_[method]_[scenario]_[expected]()
|
|
|
113
144
|
|
|
114
145
|
| 类型 | 用途 | 使用时机 |
|
|
115
146
|
|------|---------|-------------|
|
|
116
|
-
| **Stub** |
|
|
117
|
-
| **Mock** |
|
|
118
|
-
| **Fake** |
|
|
119
|
-
| **Spy** |
|
|
147
|
+
| **Stub** | 返回预定义值 | 固定的 API 响应 |
|
|
148
|
+
| **Mock** | 验证交互 | 检查方法是否被调用 |
|
|
149
|
+
| **Fake** | 简化实现 | 内存数据库 |
|
|
150
|
+
| **Spy** | 记录调用、委派 | 部分 Mock |
|
|
120
151
|
|
|
121
|
-
###
|
|
152
|
+
### 何时使用何种
|
|
122
153
|
|
|
123
|
-
- **UT
|
|
124
|
-
- **IT
|
|
125
|
-
- **ST
|
|
126
|
-
- **E2E
|
|
154
|
+
- **UT**:对所有外部依赖使用 mock/stub
|
|
155
|
+
- **IT**:数据库使用 fake,外部 API 使用 stub
|
|
156
|
+
- **ST**:真实组件,仅对外部服务使用 fake
|
|
157
|
+
- **E2E**:一切均为真实
|
|
127
158
|
|
|
128
159
|
## AAA 模式
|
|
129
160
|
|
|
130
161
|
```typescript
|
|
131
162
|
test('method_scenario_expected', () => {
|
|
132
|
-
// Arrange -
|
|
163
|
+
// Arrange - Setup test data
|
|
133
164
|
const input = createTestInput();
|
|
134
165
|
const sut = new SystemUnderTest();
|
|
135
166
|
|
|
136
|
-
// Act -
|
|
167
|
+
// Act - Execute behavior
|
|
137
168
|
const result = sut.execute(input);
|
|
138
169
|
|
|
139
|
-
// Assert -
|
|
170
|
+
// Assert - Verify result
|
|
140
171
|
expect(result).toBe(expected);
|
|
141
172
|
});
|
|
142
173
|
```
|
|
143
174
|
|
|
144
|
-
## FIRST
|
|
175
|
+
## FIRST 原则
|
|
145
176
|
|
|
146
|
-
- **F**ast(快速) -
|
|
147
|
-
- **I**ndependent
|
|
148
|
-
- **R**epeatable
|
|
149
|
-
- **S**elf-validating(自我验证) -
|
|
150
|
-
- **T**imely(及时) -
|
|
177
|
+
- **F**ast(快速) - 测试执行迅速
|
|
178
|
+
- **I**ndependent(独立) - 测试之间互不影响
|
|
179
|
+
- **R**epeatable(可重复) - 每次执行结果相同
|
|
180
|
+
- **S**elf-validating(自我验证) - 明确的通过/失败
|
|
181
|
+
- **T**imely(及时) - 与生产代码一起编写
|
|
151
182
|
|
|
152
183
|
## 应避免的反模式
|
|
153
184
|
|
|
154
|
-
- ❌
|
|
155
|
-
- ❌
|
|
156
|
-
- ❌
|
|
157
|
-
- ❌
|
|
158
|
-
- ❌
|
|
159
|
-
- ❌
|
|
185
|
+
- ❌ 测试相互依赖(测试必须按顺序执行)
|
|
186
|
+
- ❌ 不稳定测试(有时通过、有时失败)
|
|
187
|
+
- ❌ 测试实现细节
|
|
188
|
+
- ❌ 过度 Mock
|
|
189
|
+
- ❌ 缺少断言
|
|
190
|
+
- ❌ 魔术数字/字符串
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 测试理论要点(YAML 压缩)
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
# === ISTQB FUNDAMENTALS ===
|
|
198
|
+
terminology:
|
|
199
|
+
error: "Human mistake in thinking"
|
|
200
|
+
defect: "Bug in code (caused by error)"
|
|
201
|
+
failure: "System behaves incorrectly (caused by defect)"
|
|
202
|
+
chain: "Error → Defect → Failure"
|
|
203
|
+
|
|
204
|
+
oracle_problem:
|
|
205
|
+
definition: "How do we know the expected result is correct?"
|
|
206
|
+
approaches:
|
|
207
|
+
- specification_oracle: "Compare against spec"
|
|
208
|
+
- reference_oracle: "Compare against reference impl"
|
|
209
|
+
- consistency_oracle: "Same input → same output"
|
|
210
|
+
- heuristic_oracle: "Reasonable approximation"
|
|
211
|
+
|
|
212
|
+
# === STATIC vs DYNAMIC ===
|
|
213
|
+
static_testing:
|
|
214
|
+
definition: "Examine without executing"
|
|
215
|
+
techniques: [reviews, walkthroughs, inspections, static_analysis]
|
|
216
|
+
finds: "Defects before runtime"
|
|
217
|
+
examples: [ESLint, SonarQube, code_review]
|
|
218
|
+
|
|
219
|
+
dynamic_testing:
|
|
220
|
+
definition: "Execute and observe behavior"
|
|
221
|
+
techniques: [unit, integration, system, acceptance]
|
|
222
|
+
finds: "Failures during execution"
|
|
223
|
+
|
|
224
|
+
# === TEST DESIGN TECHNIQUES ===
|
|
225
|
+
black_box:
|
|
226
|
+
equivalence_partitioning:
|
|
227
|
+
principle: "Divide inputs into equivalent classes"
|
|
228
|
+
example: "Age: [<0 invalid], [0-17 minor], [18-64 adult], [65+ senior]"
|
|
229
|
+
boundary_value:
|
|
230
|
+
principle: "Test at boundaries of partitions"
|
|
231
|
+
example: "Age: test -1, 0, 17, 18, 64, 65"
|
|
232
|
+
decision_table:
|
|
233
|
+
principle: "Combinations of conditions → actions"
|
|
234
|
+
use: "Complex business rules"
|
|
235
|
+
state_transition:
|
|
236
|
+
principle: "Valid sequences of states"
|
|
237
|
+
use: "Workflow, state machines"
|
|
238
|
+
|
|
239
|
+
white_box:
|
|
240
|
+
statement_coverage: "Every statement executed once"
|
|
241
|
+
branch_coverage: "Every decision branch taken"
|
|
242
|
+
condition_coverage: "Every condition T/F"
|
|
243
|
+
path_coverage: "Every possible path (often impractical)"
|
|
244
|
+
|
|
245
|
+
# === RISK-BASED TESTING ===
|
|
246
|
+
risk_assessment:
|
|
247
|
+
likelihood: "How likely to fail?"
|
|
248
|
+
impact: "How bad if fails?"
|
|
249
|
+
priority: "likelihood × impact"
|
|
250
|
+
|
|
251
|
+
risk_matrix:
|
|
252
|
+
high_high: "Test extensively, first priority"
|
|
253
|
+
high_low: "Good coverage"
|
|
254
|
+
low_high: "Good coverage"
|
|
255
|
+
low_low: "Basic coverage"
|
|
256
|
+
|
|
257
|
+
# === DEFECT MANAGEMENT ===
|
|
258
|
+
defect_lifecycle:
|
|
259
|
+
states: [new, assigned, in_progress, fixed, verified, closed]
|
|
260
|
+
reopen_trigger: "Verification fails"
|
|
261
|
+
|
|
262
|
+
severity_vs_priority:
|
|
263
|
+
severity: "Technical impact (critical/major/minor/trivial)"
|
|
264
|
+
priority: "Business urgency (high/medium/low)"
|
|
265
|
+
example: "Typo on login page: low severity, high priority (brand)"
|
|
266
|
+
|
|
267
|
+
# === TEST ENVIRONMENT ===
|
|
268
|
+
isolation_levels:
|
|
269
|
+
unit: "In-memory, mocked deps"
|
|
270
|
+
integration: "Containerized DB (Docker)"
|
|
271
|
+
staging: "Production-like, isolated"
|
|
272
|
+
production: "Real, feature flags for testing"
|
|
273
|
+
|
|
274
|
+
test_data_strategies:
|
|
275
|
+
fixtures: "Static predefined data"
|
|
276
|
+
factories: "Dynamic generation (faker)"
|
|
277
|
+
snapshots: "Sanitized production copy"
|
|
278
|
+
synthetic: "Algorithm-generated edge cases"
|
|
279
|
+
```
|
|
160
280
|
|
|
161
281
|
---
|
|
162
282
|
|
|
163
|
-
##
|
|
283
|
+
## 设置侦测
|
|
164
284
|
|
|
165
|
-
本 Skill
|
|
285
|
+
本 Skill 支持项目特定的设置。
|
|
166
286
|
|
|
167
|
-
###
|
|
287
|
+
### 侦测顺序
|
|
168
288
|
|
|
169
|
-
1. 检查 `CONTRIBUTING.md`
|
|
170
|
-
- 如果列出此 Skill
|
|
171
|
-
2. 检查 `CONTRIBUTING.md`
|
|
172
|
-
3.
|
|
289
|
+
1. 检查 `CONTRIBUTING.md` 的「Disabled Skills」(停用 Skills)区段
|
|
290
|
+
- 如果列出此 Skill,则其在该项目被停用
|
|
291
|
+
2. 检查 `CONTRIBUTING.md` 的「Testing Standards」(测试标准)区段
|
|
292
|
+
3. 若未找到,**默认使用标准覆盖率目标**
|
|
173
293
|
|
|
174
294
|
### 首次设置
|
|
175
295
|
|
|
176
296
|
若未找到设置且上下文不清楚时:
|
|
177
297
|
|
|
178
|
-
1.
|
|
179
|
-
2.
|
|
298
|
+
1. 询问用户:「此项目尚未配置测试标准。您想要自定义覆盖率目标吗?」
|
|
299
|
+
2. 用户选择后,建议在 `CONTRIBUTING.md` 中记录:
|
|
180
300
|
|
|
181
301
|
```markdown
|
|
182
302
|
## Testing Standards
|
|
@@ -189,7 +309,7 @@ test('method_scenario_expected', () => {
|
|
|
189
309
|
| Function | 85% |
|
|
190
310
|
```
|
|
191
311
|
|
|
192
|
-
###
|
|
312
|
+
### 设置示例
|
|
193
313
|
|
|
194
314
|
在项目的 `CONTRIBUTING.md` 中:
|
|
195
315
|
|
|
@@ -211,60 +331,37 @@ test('method_scenario_expected', () => {
|
|
|
211
331
|
|
|
212
332
|
---
|
|
213
333
|
|
|
214
|
-
##
|
|
215
|
-
|
|
216
|
-
- [测试标准](../../../../core/testing-standards.md)
|
|
217
|
-
- [程序码审查检查清单](../../../../core/code-review-checklist.md)
|
|
334
|
+
## 下一步引导 | Next Steps Guidance
|
|
218
335
|
|
|
219
|
-
|
|
336
|
+
`/testing` 完成后,AI 助理应建议:
|
|
220
337
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
| 1.1.0 | 2025-12-29 | 新增:框架选择(ISTQB/业界通行金字塔)、IT/SIT 縮写说明 |
|
|
226
|
-
| 1.0.0 | 2025-12-24 | 新增:标准區段(目的、相关标准、版本历史、授权) |
|
|
338
|
+
> **测试标准与最佳实践已掌握。建议下一步 / Testing standards and best practices understood. Suggested next steps:**
|
|
339
|
+
> - 执行 `/tdd` 开始测试驱动开发(红-绿-重构循环) ⭐ **推荐 / Recommended** — 将测试知识立即转化为实践 / Turn testing knowledge into practice immediately
|
|
340
|
+
> - 执行 `/coverage` 分析当前代码覆盖率 — 找出测试缺口 / Identify testing gaps
|
|
341
|
+
> - 执行 `/bdd` 编写行为驱动的 Given-When-Then 场景 — 从用户角度定义测试 / Define tests from user perspective
|
|
227
342
|
|
|
228
343
|
---
|
|
229
344
|
|
|
230
|
-
##
|
|
231
|
-
|
|
232
|
-
本 Skill 以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授权發布。
|
|
233
|
-
|
|
234
|
-
**來源**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
## Next Steps Guidance | 下一步引導
|
|
238
|
-
|
|
239
|
-
After `/testing` completes, the AI assistant should suggest:
|
|
240
|
-
|
|
241
|
-
> **測試標準與最佳實踐已掌握。建議下一步 / Testing standards and best practices understood. Suggested next steps:**
|
|
242
|
-
> - 執行 `/tdd` 開始測試驅動開發(紅-綠-重構循環) ⭐ **Recommended / 推薦** — 將測試知識立即轉化為實踐 / Turn testing knowledge into practice immediately
|
|
243
|
-
> - 執行 `/coverage` 分析目前程式碼覆蓋率 — 找出測試缺口 / Identify testing gaps
|
|
244
|
-
> - 執行 `/bdd` 撰寫行為驅動的 Given-When-Then 場景 — 從使用者角度定義測試 / Define tests from user perspective
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## Related Standards
|
|
345
|
+
## 相关标准
|
|
249
346
|
|
|
250
|
-
- [
|
|
251
|
-
- [
|
|
252
|
-
- [
|
|
347
|
+
- [测试标准](../../core/testing-standards.md) - 可执行的规则
|
|
348
|
+
- [测试理论](./testing-theory.md) - 教学型知识库
|
|
349
|
+
- [代码审查检查清单](../../core/code-review-checklist.md)
|
|
253
350
|
|
|
254
351
|
---
|
|
255
352
|
|
|
256
|
-
##
|
|
353
|
+
## 版本历史
|
|
257
354
|
|
|
258
|
-
|
|
|
355
|
+
| 版本 | 日期 | 变更内容 |
|
|
259
356
|
|---------|------|---------|
|
|
260
|
-
| 1.2.0 | 2026-01-29 |
|
|
261
|
-
| 1.1.0 | 2025-12-29 |
|
|
262
|
-
| 1.0.0 | 2025-12-24 |
|
|
357
|
+
| 1.2.0 | 2026-01-29 | 新增指向新建 testing-theory.md 知识库的链接 |
|
|
358
|
+
| 1.1.0 | 2025-12-29 | 新增测试理论要点 YAML 区段 |
|
|
359
|
+
| 1.0.0 | 2025-12-24 | 初版:标准区段(目的、相关标准、版本历史、授权) |
|
|
263
360
|
|
|
264
361
|
---
|
|
265
362
|
|
|
266
|
-
##
|
|
363
|
+
## 授权
|
|
267
364
|
|
|
268
|
-
|
|
365
|
+
本 Skill 以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授权发布。
|
|
269
366
|
|
|
270
|
-
|
|
367
|
+
**来源**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../CHANGELOG.md
|
|
3
|
-
source_version: 5.
|
|
4
|
-
translation_version: 5.
|
|
5
|
-
last_synced: 2026-
|
|
3
|
+
source_version: 5.17.0
|
|
4
|
+
translation_version: 5.17.0
|
|
5
|
+
last_synced: 2026-06-08
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -17,6 +17,26 @@ status: current
|
|
|
17
17
|
|
|
18
18
|
## [Unreleased]
|
|
19
19
|
|
|
20
|
+
## [5.17.0] - 2026-06-08
|
|
21
|
+
|
|
22
|
+
### 新增 — 可執行 SDD 一致性與 AC 格式擴充(XSPEC-262/263/264)
|
|
23
|
+
|
|
24
|
+
- **`/sdd analyze` 跨 artifact 一致性(XSPEC-262,`scripts/sdd-analyze.ts`)**:acceptance-criteria-traceability + forward-derivation single-spine 的可執行面。7 類信號——孤兒測試/未覆蓋/not_implemented/跨 spec AC 衝突/孤兒 .feature/AC 無 scenario/手冊↔E2E drift(`T-NNN`,實現 XSPEC-260 R5)。`npm run sdd:analyze`;12 bats 測試。
|
|
25
|
+
- **EARS 記法作為可選 AC 格式(XSPEC-263)**:spec-driven-development v2.3.0 加 5 種 EARS 模板;schema 加可選 `ears` 欄位(given/when/then 由 required 放寬、向後相容)。GWT 維持預設首選。
|
|
26
|
+
- **結構化 Bugfix 規格模板(XSPEC-264)**:sdd-guide 決策樹細分 trivial vs regression-prone,新增輕量 `<BUG-ID>.bugfix.md` 模板(current/expected/**unchanged** + root-cause + regression-test 當 AC)。
|
|
27
|
+
|
|
28
|
+
> 註:Bugfix 模板的 sdd-guide locale(zh-TW/zh-CN)同步交 XSPEC-248 迴路(既有 locale drift)。
|
|
29
|
+
|
|
30
|
+
## [5.16.0] - 2026-06-08
|
|
31
|
+
|
|
32
|
+
### 新增 — 測試推導鏈延伸至使用者指南(XSPEC-260)
|
|
33
|
+
|
|
34
|
+
- **`core/forward-derivation-standards.md`**:新增 `## Terminal Projection: User Guide`(終端投影:使用者指南)段 + `### Single-Spine Principle`(單一主幹原則)。把推導管道從測試延伸到使用者指南——使用者指南是 journey/E2E 測試以機器驗證的同一條 AC 主幹的終端投影。定義共用 `T-NNN` 編號(使用者指南步驟的 `T-NNN` 必須等於某個真實 journey/E2E 測試的 id)、user-facing AC 篩選與保守預設,以及單一主幹原則:測試/文件來源是同一 AC 主幹的 N×1 投影、非 N×N 平行對照;另立平行編號體系即為違規。
|
|
35
|
+
- **`ai/standards/forward-derivation-standards.ai.yaml`**:對應 `terminal_projection` 區塊 + 3 條 rules(`single-spine-no-parallel-numbering`、`user-guide-shared-tnnn`、`user-facing-ac-conservative-default`)。
|
|
36
|
+
- **`core/acceptance-criteria-traceability.md`**:新增 `## User-Documentation Coverage`(使用者文件覆蓋)維度——追蹤 user-facing AC 是否被使用者指南記載。含 user-facing AC 篩選(保守預設:判不準歸 user-facing)、沿用 ✅/⚠️/❌ 狀態,及排除非 user-facing 與 `not_implemented` AC 的覆蓋率公式。
|
|
37
|
+
- **`ai/standards/acceptance-criteria-traceability.ai.yaml`**:對應 `user_doc_coverage` 區塊 + 2 條 rules(`user-doc-user-facing-only`、`user-doc-shared-tnnn`)。
|
|
38
|
+
- **zh-TW / zh-CN 語言版**:兩標準的新段落均完整翻譯。
|
|
39
|
+
|
|
20
40
|
## [5.15.0] - 2026-05-28
|
|
21
41
|
|
|
22
42
|
### 新增 — i18n 分層語言策略(XSPEC-239)
|
|
@@ -14,7 +14,7 @@ status: current
|
|
|
14
14
|
|
|
15
15
|
> **語言**: [English](../../README.md) | 繁體中文 | [简体中文](../zh-CN/README.md)
|
|
16
16
|
|
|
17
|
-
**版本**: 5.
|
|
17
|
+
**版本**: 5.17.0 | **發布日期**: 2026-05-28 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
|
|
18
18
|
|
|
19
19
|
語言無關、框架無關的軟體專案文件標準。透過 AI 原生工作流,確保不同技術堆疊之間的一致性、品質和可維護性。
|
|
20
20
|
|
|
@@ -116,6 +116,52 @@ Coverage = (5 + 2×0.5) / 8 = 6/8 = 75%
|
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
119
|
+
## 使用者文件覆蓋
|
|
120
|
+
|
|
121
|
+
上方的 AC↔測試矩陣驗證 AC 是否被*測試*。第二個維度則驗證 **user-facing AC 是否同時被使用者指南記載**。這把可追溯主幹從測試延伸到使用者指南——見正向推演標準 →《終端投影:使用者指南》。使用者指南與 journey/E2E 套件是同一作業流程的兩個投影,因此共用一把尺:`T-NNN`。
|
|
122
|
+
|
|
123
|
+
### User-Facing AC 篩選
|
|
124
|
+
|
|
125
|
+
此維度**只套用於 user-facing AC**——終端使用者可直接觀察或操作者。如此可避免此維度退化成對每個內部 AC 的全面文件義務。
|
|
126
|
+
|
|
127
|
+
| AC 類型 | user-facing? |
|
|
128
|
+
|---------|--------------|
|
|
129
|
+
| UI 流程、畫面、導覽 | 是 |
|
|
130
|
+
| 使用者執行的 CLI 指令/旗標 | 是 |
|
|
131
|
+
| 對外 API 的使用者語意(使用者呼叫的公開契約)| 是 |
|
|
132
|
+
| 內部重構/模組契約 | 否 |
|
|
133
|
+
| 效能門檻、容量 | 否 |
|
|
134
|
+
| 安全內控、內部護欄 | 否 |
|
|
135
|
+
|
|
136
|
+
**保守預設**:判不準時一律歸 user-facing。排除某個 AC 必須**明確標記**(如 `user_facing: false`),絕不靜默省略。
|
|
137
|
+
|
|
138
|
+
### 使用者文件狀態
|
|
139
|
+
|
|
140
|
+
沿用相同符號,改回答「此 user-facing AC 是否被某個使用者指南步驟覆蓋?」:
|
|
141
|
+
|
|
142
|
+
| 狀態 | 符號 | 定義 |
|
|
143
|
+
|------|------|------|
|
|
144
|
+
| **已記載** | ✅ | 有使用者指南步驟覆蓋此 AC,並標上該 AC 共用的 `T-NNN` |
|
|
145
|
+
| **部分** | ⚠️ | 有使用者指南步驟但不完整或標記模稜兩可 |
|
|
146
|
+
| **未記載** | ❌ | 無任何使用者指南步驟引用此 user-facing AC |
|
|
147
|
+
|
|
148
|
+
`not_implemented`(🚫)AC 排除於使用者文件分母之外,與測試覆蓋率計算一致。
|
|
149
|
+
|
|
150
|
+
### 使用者文件覆蓋率計算
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
使用者文件覆蓋率 % = (已記載 + 部分 × 0.5) / (user_facing_ac_count - not_implemented_count) × 100
|
|
154
|
+
|
|
155
|
+
其中:
|
|
156
|
+
user_facing_ac_count = 歸類為 user-facing 的 AC 數(套用保守預設)
|
|
157
|
+
非 user-facing AC 不計入分子也不計入分母
|
|
158
|
+
部分計為 0.5
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
> **同一把尺**:使用者指南步驟的 `T-NNN` 必須等於某個真實 journey/E2E 測試的 id(正向推演標準)。這把同一 AC 的三個投影——測試、journey、使用者指南——綁到單一主幹。自造平行 id 卻無對應測試的使用者指南步驟,一律報為**未記載**,絕不算覆蓋。
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
119
165
|
## 品質門檻
|
|
120
166
|
|
|
121
167
|
### 預設門檻
|