bpmax-cli 0.2.1-beta.5 → 0.2.1-beta.50

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.
Files changed (152) hide show
  1. package/README.md +13 -5
  2. package/dist/bin.js +25216 -12623
  3. package/dist/bin.js.map +1 -1
  4. package/package.json +10 -5
  5. package/scripts/run-source-cli.mjs +121 -0
  6. package/skills/bpmax-ai-taskbook/SKILL.md +2 -0
  7. package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
  8. package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
  9. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
  10. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
  11. package/skills/bpmax-approval-matrix/SKILL.md +54 -2
  12. package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
  13. package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
  14. package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
  15. package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
  16. package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
  17. package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
  18. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
  19. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
  20. package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
  21. package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
  22. package/skills/bpmax-bug-reporting/SKILL.md +72 -0
  23. package/skills/bpmax-builder-shared/SKILL.md +1 -0
  24. package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
  25. package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
  26. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
  27. package/skills/bpmax-cli/SKILL.md +43 -0
  28. package/skills/bpmax-config-latest/SKILL.md +4 -0
  29. package/skills/bpmax-console-template-editor/SKILL.md +112 -523
  30. package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
  31. package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
  32. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
  33. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
  34. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
  35. package/skills/bpmax-dataset-field-template-editor/SKILL.md +127 -594
  36. package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
  37. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
  38. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
  39. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
  40. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
  41. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
  42. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
  43. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
  44. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
  45. package/skills/bpmax-dataset-template-editor/SKILL.md +116 -778
  46. package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
  47. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
  48. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
  49. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
  50. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
  51. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
  52. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
  53. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
  54. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
  55. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
  56. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
  57. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
  58. package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
  59. package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
  60. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +150 -546
  61. package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
  62. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +136 -13
  63. package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +85 -0
  64. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +6 -5
  65. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +576 -0
  66. package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +2 -0
  67. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
  68. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
  69. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
  70. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
  71. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
  72. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
  73. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
  74. package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
  75. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
  76. package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
  77. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
  78. package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
  79. package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
  80. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
  81. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
  82. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
  83. package/skills/bpmax-flow/SKILL.md +2 -0
  84. package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
  85. package/skills/bpmax-flow-template-editor/SKILL.md +120 -1084
  86. package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
  87. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
  88. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
  89. package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +2 -1
  90. package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1157 -0
  91. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
  92. package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
  93. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
  94. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
  95. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
  96. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +8 -2
  97. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
  98. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
  99. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
  100. package/skills/bpmax-form-template-editor/SKILL.md +133 -1104
  101. package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
  102. package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
  103. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
  104. package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
  105. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
  106. package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
  107. package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
  108. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
  109. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
  110. package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
  111. package/skills/bpmax-functional-test-design/SKILL.md +80 -0
  112. package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
  113. package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
  114. package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
  115. package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
  116. package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
  117. package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
  118. package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
  119. package/skills/bpmax-group-model-editor/SKILL.md +24 -0
  120. package/skills/bpmax-list-template-editor/SKILL.md +119 -466
  121. package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
  122. package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
  123. package/skills/bpmax-list-template-editor/references/full-detail-guide.md +458 -0
  124. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
  125. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
  126. package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
  127. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
  128. package/skills/bpmax-memory-protocol/SKILL.md +7 -6
  129. package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
  130. package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
  131. package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
  132. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
  133. package/skills/bpmax-plugin-config/SKILL.md +20 -4
  134. package/skills/bpmax-project/SKILL.md +37 -1
  135. package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
  136. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
  137. package/skills/bpmax-role-editor/SKILL.md +7 -30
  138. package/skills/bpmax-shared/SKILL.md +19 -9
  139. package/skills/bpmax-team-editor/SKILL.md +27 -0
  140. package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
  141. package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
  142. package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
  143. package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
  144. package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
  145. package/skills/bpmax-user/SKILL.md +33 -1
  146. package/skills/bpmax-user-mock-operator/SKILL.md +20 -48
  147. package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
  148. package/skills/bpmax-user-model-editor/SKILL.md +24 -0
  149. package/skills/form-control-library/references/form-template-submit-schema.md +1 -1
  150. package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
  151. package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
  152. package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
@@ -14,11 +14,11 @@
14
14
  1. 通过真实线上接口确认详情结构
15
15
  2. 导出 `raw` / `work` / `meta`
16
16
  3. 修改 `work`
17
- 4. 记录建模决策 gate,执行需求范围 gate,并向用户展示 `work diff` 做第一次确认
18
- 5. 构建 `submit`
19
- 6. 运行语义 lint,确认没有 blocker
17
+ 4. 运行 typed CLI lint,确认没有 blocker
18
+ 5. 记录建模决策 gate,执行需求范围 gate,并向用户展示 `work diff` 做第一次确认
19
+ 6. 构建 `submit`
20
20
  7. 再次执行需求范围 gate,向用户展示 `submit diff` 并做第二次确认
21
- 8. 执行提交脚本
21
+ 8. 执行 typed CLI submit
22
22
  9. 回读草稿态和发布态
23
23
  10. 查看 verify / drift 报告,并再次执行需求范围 gate
24
24
  11. 如任务要求页面生效,再做 flow 引用和运行页验收
@@ -26,10 +26,12 @@
26
26
  - `fields.<field>.rule.field` 是否等于字段 key
27
27
  - `fields.<field>.value.field` 是否等于字段 key
28
28
  - `fields.<field>.value.field_type` 是否与 `rule.type` 对齐
29
+ - `h_label` / `description` / `i_hr` / `divider` 是否未设置 `rule.title` 和 `value.title`;标题或说明正文是否只放在 `rule.props.text`
30
+ - 是否保留展示控件内部 `field` 作为 layout 引用;不要把“无字段标签”误改成“删除内部 field”
29
31
  - `removedFields` 是否只包含确实要删除的字段
30
32
 
31
33
  ## submit 文件
32
- - 是否由 `build_submit_payload.py` 生成,而不是手写
34
+ - 是否由 `bpmax-cli config form-template build` 生成,而不是手写
33
35
  - 是否再次完成需求范围 gate
34
36
  - `submit diff` 是否没有比已确认的 `work diff` 多出新的基础信息、布局、控件、字段属性、脚本、校验或子表单引用变化
35
37
  - 是否没有未确认的 `required-collateral`
@@ -10,6 +10,12 @@
10
10
  - 子表单单独建模板
11
11
  - 一条子表单记录表示一条明细
12
12
 
13
+ ## 表格列宽
14
+ - `props.mode = "table"` 时,桌面预览至少保留一个自适应数据列,避免所有列宽写死后在宽屏留白或窄屏拥挤。
15
+ - 当前可验证的自适应配置是:`props.applyColWidthOnPreview=false`(或省略),并且不设置 `fixed_left_fields` / `fixed_right_fields`。此时桌面预览的数据列不传 `width`,由表格自动分配剩余空间。
16
+ - `col_width` 可以保留整数像素列表供编辑态、移动端或回退宽度使用,但不要在其中写空项、`auto` 或百分比冒充自适应列。
17
+ - 当前平台不支持“固定部分列,同时让至少一列自适应”:配置任一固定列后,运行时会给全部数据列固定宽度。遇到这类需求应标记平台能力 blocker,而不是绕过 `[form.sub_form.adaptive_column_required]` lint。
18
+
13
19
  ## 销售出库流程的落地经验(2026-04-11)
14
20
 
15
21
  ### 目标
@@ -393,6 +393,14 @@ def _validate_field_bundle(field: str, bundle: Any) -> tuple[Dict[str, Any], Dic
393
393
  raise SystemExit(f"value field mismatch for {field}")
394
394
  if value_payload.get("field_type") != rule_payload.get("type"):
395
395
  raise SystemExit(f"value field_type mismatch for {field}")
396
+ value_config = value_payload.get("value")
397
+ if not isinstance(value_config, dict):
398
+ raise SystemExit(f"field {field} value.value must be object")
399
+ validate_map = value_config.get("validateMap")
400
+ if not isinstance(validate_map, dict):
401
+ raise SystemExit(f"field {field} value.validateMap must be object")
402
+ if "required" not in validate_map:
403
+ raise SystemExit(f"field {field} value.validateMap.required is required")
396
404
  if rule_payload.get("lambda") and rule_payload.get("quickValue") is not True:
397
405
  raise SystemExit(f"field {field} has lambda but quickValue is not true")
398
406
  return rule_payload, value_payload
@@ -70,14 +70,14 @@ def make_detail() -> dict:
70
70
  "field": "F1mymko1vmyub8c",
71
71
  "field_type": "h_label",
72
72
  "key": None,
73
- "value": {"type": "h_label"},
73
+ "value": {"type": "h_label", "validateMap": {"required": False}},
74
74
  "template_id": 990702153,
75
75
  },
76
76
  {
77
77
  "field": "3q96an3nsvnu",
78
78
  "field_type": "plugin_scan_input",
79
79
  "key": "sn",
80
- "value": {"type": "plugin_scan_input", "value": ""},
80
+ "value": {"type": "plugin_scan_input", "value": "", "validateMap": {"required": False}},
81
81
  "template_id": 990702153,
82
82
  },
83
83
  ],
@@ -160,6 +160,25 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
160
160
  with self.assertRaises(SystemExit):
161
161
  build_submit_payload(work)
162
162
 
163
+ def test_build_submit_payload_requires_value_validate_map_required(self) -> None:
164
+ work = detail_to_work_payload(make_detail(), mode="edit")
165
+ del work["fields"]["3q96an3nsvnu"]["value"]["value"]["validateMap"]
166
+
167
+ with self.assertRaisesRegex(SystemExit, "value.validateMap must be object"):
168
+ build_submit_payload(work)
169
+
170
+ work = detail_to_work_payload(make_detail(), mode="edit")
171
+ del work["fields"]["3q96an3nsvnu"]["value"]["value"]["validateMap"]["required"]
172
+
173
+ with self.assertRaisesRegex(SystemExit, "value.validateMap.required is required"):
174
+ build_submit_payload(work)
175
+
176
+ def test_legacy_submit_script_is_disabled(self) -> None:
177
+ sys.modules.pop("submit_form_template", None)
178
+ with self.assertRaises(SystemExit) as ctx:
179
+ __import__("submit_form_template")
180
+ self.assertEqual(ctx.exception.code, 2)
181
+
163
182
  def test_semantic_lint_blocks_project_list_query(self) -> None:
164
183
  work = detail_to_work_payload(make_detail(), mode="edit")
165
184
  work["fields"]["3q96an3nsvnu"]["rule"]["lambda"] = (
@@ -194,7 +213,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
194
213
  "field": "Freturndatex1",
195
214
  "field_type": "bp-date-picker",
196
215
  "key": "ex_time",
197
- "value": {"type": "bp-date-picker", "value": ""},
216
+ "value": {"type": "bp-date-picker", "value": "", "validateMap": {"required": False}},
198
217
  "template_id": 990702153,
199
218
  }
200
219
  )
@@ -215,7 +234,11 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
215
234
  detail["rule"][1][0]["lambda"] = "return ctx.$FORM_KEY.sn;"
216
235
  detail["rule"][1][0]["quickValue"] = True
217
236
  detail["value"][1]["field_type"] = "i_input"
218
- detail["value"][1]["value"] = {"type": "i_input", "value": ""}
237
+ detail["value"][1]["value"] = {
238
+ "type": "i_input",
239
+ "value": "",
240
+ "validateMap": {"required": False},
241
+ }
219
242
 
220
243
  work = detail_to_work_payload(detail, mode="edit")
221
244
  report = lint_form_template_semantics(work, meta=self._lint_meta())
@@ -243,7 +266,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
243
266
  "field": "Fsalepersonx1",
244
267
  "field_type": "raw",
245
268
  "key": "salesman",
246
- "value": {"type": "raw", "value": ""},
269
+ "value": {"type": "raw", "value": "", "validateMap": {"required": False}},
247
270
  "template_id": 990702153,
248
271
  }
249
272
  )
@@ -277,7 +300,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
277
300
  "field": "Fdealercode1",
278
301
  "field_type": "i_input",
279
302
  "key": "dealer_code",
280
- "value": {"type": "i_input", "value": ""},
303
+ "value": {"type": "i_input", "value": "", "validateMap": {"required": False}},
281
304
  "template_id": 990702153,
282
305
  }
283
306
  )
@@ -311,7 +334,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
311
334
  "field": "Freturndatex1",
312
335
  "field_type": "bp-date-picker",
313
336
  "key": "ex_time",
314
- "value": {"type": "bp-date-picker", "value": ""},
337
+ "value": {"type": "bp-date-picker", "value": "", "validateMap": {"required": False}},
315
338
  "template_id": 990702153,
316
339
  }
317
340
  )
@@ -621,7 +644,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
621
644
  "field": "raw-field",
622
645
  "field_type": "raw",
623
646
  "key": "rawDisplay",
624
- "value": {"type": "raw"},
647
+ "value": {"type": "raw", "validateMap": {"required": False}},
625
648
  }
626
649
  )
627
650
  work = detail_to_work_payload(detail, mode="edit")
@@ -664,7 +687,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
664
687
  "field": "auto-salesman",
665
688
  "field_type": "raw",
666
689
  "key": "salesman",
667
- "value": {"type": "raw"},
690
+ "value": {"type": "raw", "validateMap": {"required": False}},
668
691
  }
669
692
  )
670
693
  work = detail_to_work_payload(detail, mode="edit")
@@ -718,13 +741,13 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
718
741
  "field": "auto-driver",
719
742
  "field_type": "raw",
720
743
  "key": "auto_driver",
721
- "value": {"type": "raw"},
744
+ "value": {"type": "raw", "validateMap": {"required": False}},
722
745
  },
723
746
  {
724
747
  "field": "visible-time",
725
748
  "field_type": "bp-date-picker",
726
749
  "key": "ex_time",
727
- "value": {"type": "bp-date-picker", "value": ""},
750
+ "value": {"type": "bp-date-picker", "value": "", "validateMap": {"required": False}},
728
751
  },
729
752
  ]
730
753
  )
@@ -779,13 +802,13 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
779
802
  "field": "auto-driver",
780
803
  "field_type": "raw",
781
804
  "key": "auto_driver",
782
- "value": {"type": "raw"},
805
+ "value": {"type": "raw", "validateMap": {"required": False}},
783
806
  },
784
807
  {
785
808
  "field": "visible-sku",
786
809
  "field_type": "i_input",
787
810
  "key": "sku",
788
- "value": {"type": "i_input", "value": ""},
811
+ "value": {"type": "i_input", "value": "", "validateMap": {"required": False}},
789
812
  },
790
813
  ]
791
814
  )
@@ -820,7 +843,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
820
843
  "field": "choice-driver",
821
844
  "field_type": "raw",
822
845
  "key": "choice_driver",
823
- "value": {"type": "raw"},
846
+ "value": {"type": "raw", "validateMap": {"required": False}},
824
847
  }
825
848
  )
826
849
  work = detail_to_work_payload(detail, mode="edit")
@@ -861,7 +884,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
861
884
  "field": "dealer-code",
862
885
  "field_type": "i_input",
863
886
  "key": "robo_salechannelcode",
864
- "value": {"type": "i_input"},
887
+ "value": {"type": "i_input", "validateMap": {"required": False}},
865
888
  }
866
889
  )
867
890
  work = detail_to_work_payload(detail, mode="edit")
@@ -910,7 +933,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
910
933
  "field": "dealer-code",
911
934
  "field_type": "i_input",
912
935
  "key": "robo_salechannelcode",
913
- "value": {"type": "i_input"},
936
+ "value": {"type": "i_input", "validateMap": {"required": False}},
914
937
  }
915
938
  )
916
939
  work = detail_to_work_payload(detail, mode="edit")
@@ -962,7 +985,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
962
985
  "field": "dealer-sap",
963
986
  "field_type": "i_input",
964
987
  "key": "dealer_sap_code",
965
- "value": {"type": "i_input"},
988
+ "value": {"type": "i_input", "validateMap": {"required": False}},
966
989
  }
967
990
  )
968
991
  work = detail_to_work_payload(detail, mode="edit")
@@ -999,7 +1022,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
999
1022
  "field": "dealer-sap",
1000
1023
  "field_type": "i_input",
1001
1024
  "key": "dealer_sap_code",
1002
- "value": {"type": "i_input"},
1025
+ "value": {"type": "i_input", "validateMap": {"required": False}},
1003
1026
  }
1004
1027
  )
1005
1028
  work = detail_to_work_payload(detail, mode="edit")
@@ -1074,7 +1097,7 @@ class FormTemplateEditorCommonTests(unittest.TestCase):
1074
1097
  "field": "sub-form-field",
1075
1098
  "field_type": "sub_form",
1076
1099
  "key": "list",
1077
- "value": {"type": "sub_form"},
1100
+ "value": {"type": "sub_form", "validateMap": {"required": False}},
1078
1101
  }
1079
1102
  )
1080
1103
  work = detail_to_work_payload(detail, mode="edit")
@@ -0,0 +1,24 @@
1
+ Adapted from https://github.com/phatnguyen975/functional-test-design
2
+ Upstream commit: 7837e80199847a8fb46f53fed5cc23826f7fa8da
3
+
4
+ MIT License
5
+
6
+ Copyright (c) 2026 Nguyễn Tấn Phát
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: bpmax-functional-test-design
3
+ description: Use when designing BPMAX functional test cases from requirements, business rules, field constraints, approval conditions, lifecycle states, user journeys, APIs, flows, templates, or .ai_test scenarios before implementation or E2E execution.
4
+ ---
5
+
6
+ # BPMAX 功能测试用例设计
7
+
8
+ ## 核心原则
9
+
10
+ 先从需求系统化推导测试用例,再进入 `.ai_test` 资产化、评审和真实执行。测试设计完成只证明“用例已设计”,不得把设计完成写成已执行或已通过。
11
+
12
+ ## 输入要求
13
+
14
+ 开始前确认并保留用户已提供的 BPMAX 标识,包括 workspace、环境、`flow_type`、项目、步骤、模板、数据集、字段和角色。不要改写、猜测或补造 ID。仅做通用方法设计时不强制要求这些标识;需要读取配置、生成 `.ai_test` 或真实执行时再补齐目标定位信息。
15
+
16
+ ### 通用最小输入
17
+
18
+ - 可识别的需求、业务规则或配置依据;
19
+ - 可判定的输入、动作与可观察预期;预期不明确时,将其列为规格缺口。
20
+
21
+ ### 按方法补充输入
22
+
23
+ - 等价类与边界值:字段类型、范围、长度、格式、精度、枚举或空值规则。
24
+ - 决策表:条件、条件取值、动作和规则优先级。
25
+ - 状态迁移:状态、事件、守卫条件、有效/无效迁移和副作用。
26
+ - 用例/E2E 场景:参与角色、用户目标、前置条件、主流程、备选/异常流程和终态。
27
+
28
+ 预期行为不明确时,先列出规格缺口和受影响的用例,不要自行决定业务结果。
29
+
30
+ ## 工作流
31
+
32
+ 1. 建立需求清单:为每项需求或业务规则分配稳定编号,如 `REQ-01`、`BR-03`。
33
+ 2. 盘点输入、条件、状态、角色、动作、输出和副作用。
34
+ 3. 读取 [technique-selection.md](references/technique-selection.md),选择一个或多个测试设计方法。
35
+ 4. 只读取被选中的方法参考:
36
+ - 输入范围、长度、格式、枚举:读取 [domain-testing.md](references/domain-testing.md)。
37
+ - 多条件共同决定结果:读取 [decision-table-testing.md](references/decision-table-testing.md)。
38
+ - 行为依赖当前状态或历史:读取 [state-transition-testing.md](references/state-transition-testing.md)。
39
+ - 角色为实现目标经过主/备选/异常流程:读取 [use-case-testing.md](references/use-case-testing.md)。
40
+ 5. 先完成分析工件,再从工件派生用例;不要凭直觉直接列用例。
41
+ 6. 为每条用例写明:编号、需求依据、使用方法、优先级、前置条件、测试数据、逐步动作、每步预期、后置状态和覆盖标签。
42
+ 7. 生成“需求/规则 → 用例”追踪矩阵,并声明覆盖目标与尚未覆盖项。
43
+ 8. 用户要求落入 BPMAX 测试资产时,读取 [bpmax-test-suite-output.md](references/bpmax-test-suite-output.md)。
44
+
45
+ ## 组合顺序
46
+
47
+ 同一需求命中多种特征时,按以下顺序避免重复和遗漏:
48
+
49
+ 1. 用例测试或状态迁移:确定完整路径与状态结构。
50
+ 2. 决策表:展开路径节点上的条件组合。
51
+ 3. 等价类与边界值:为字段和条件类选择具体测试数据。
52
+ 4. 经验补充:在系统化覆盖完成后补充并发、幂等、超时、重复操作等高风险故障假设。
53
+
54
+ ## 质量门禁
55
+
56
+ - 一条用例只验证一个主要规则、分支或路径;多步 E2E 用例必须为每一步写即时预期结果。
57
+ - 正向、负向、边界、权限、无效状态和副作用覆盖必须可追踪到需求或风险。
58
+ - 不得使用 `正常测试`、`异常情况`、`符合预期` 等不可判定描述。
59
+ - 没有当前配置或用户确认支持的结果必须标成规格缺口,而不是预期结果。
60
+ - 设计报告默认 `asset_stage=DESIGNED`;该值不是 `.ai_test` 字段。lint、review、promote、执行和 pass 必须分别有真实命令输出或运行证据。
61
+
62
+ ## BPMAX 资产和执行边界
63
+
64
+ 需要生成 `.ai_test/suite_draft` 内容时,先满足目标配置仓库的 latest proof 门禁,再按 [bpmax-test-suite-output.md](references/bpmax-test-suite-output.md) 映射字段。完成草稿后只允许声明“已生成/已 lint/已评审/已 promote”中有证据支持的状态。
65
+
66
+ ```bash
67
+ bpmax-cli test-suite lint --root .ai_test/suite_draft --scenario <scenario_id> [--scenario <same_flow_scenario_id> ...] --latest-proof <proof.json>
68
+ ```
69
+
70
+ 共享 suite 中设计单个流程时必须用 `--scenario` 隔离当前流程;该 lint 只证明所选场景结构可接受,不代表整个 suite 通过。真实页面或流程执行必须使用 `bpmax-e2e-flow-test-operator`。本 skill 不替代用户身份切换、浏览器操作、审批提交、运行 manifest 或证据记录。
71
+
72
+ ## 输出顺序
73
+
74
+ 1. 规格缺口与假设边界。
75
+ 2. 方法选择及理由。
76
+ 3. 方法分析工件(等价类表、决策表、状态表或场景矩阵)。
77
+ 4. 测试用例。
78
+ 5. 需求追踪矩阵与覆盖摘要。
79
+ 6. 资产状态:`DESIGNED`、`LINTED`、`REVIEWED`、`PROMOTED`、`EXECUTED`、`PASSED` 中真实成立的最高状态。
80
+ 7. 下一步命令或阻塞项。
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "BPMAX Functional Test Design"
3
+ short_description: "Design traceable BPMAX functional test cases"
4
+ default_prompt: "Use $bpmax-functional-test-design to design traceable functional test cases for this BPMAX requirement."
@@ -0,0 +1,95 @@
1
+ # BPMAX `.ai_test` 输出映射
2
+
3
+ ## 外部资产阶段模型
4
+
5
+ 在设计报告和交付摘要中使用 `asset_stage` 表达生命周期边界。`asset_stage` 不是当前 `.ai_test` schema 字段,不得写入 `cases.csv`、`case_steps.csv` 或 `review.json`。
6
+
7
+ | asset_stage | 含义 | 所需证据 |
8
+ |---|---|---|
9
+ | `DESIGNED` | 已从需求推导用例 | 设计工件与追踪矩阵 |
10
+ | `LINTED` | `.ai_test/suite_draft` 已通过 lint | 当前命令输出 |
11
+ | `REVIEWED` | review gate 已完成 | 合格 `review.json` 与修复记录 |
12
+ | `PROMOTED` | 已进入正式 `.ai_test/suite` | promote 输出与 copy diff |
13
+ | `EXECUTED` | 已按 manifest 真实执行 | 本轮 report、步骤证据与 record 输出 |
14
+ | `PASSED` | 全部要求的断言有本轮通过证据 | 完整运行证据 |
15
+
16
+ 阶段只能基于真实证据升级。设计内容本身默认 `asset_stage=DESIGNED`。
17
+
18
+ `.ai_test` 内部仍使用现行字段语义:目录位置表示资产工作流阶段,README 和 `cases.csv` 中的 `status=draft|active|deprecated` 表示场景与用例自身生命周期。初始设计通常使用 `status=draft`;promote 前必须显式将 README 以及准备启用的用例改为 `active`,或将不再使用的内容改为 `deprecated`。CLI 不会自动转换这些状态。不要把大写 `asset_stage` 值映射成新的 CSV 列或替代现有 `status`。
19
+
20
+ ## 场景目录
21
+
22
+ 设计输出先面向:
23
+
24
+ ```text
25
+ .ai_test/suite_draft/<scenario_id>/
26
+ README.md
27
+ cases.csv
28
+ case_steps.csv
29
+ ```
30
+
31
+ `scenario_id` 使用稳定的小写 kebab-case,并与目录名一致。不要用项目 ID 或随机时间戳替代业务场景身份。
32
+
33
+ 初始设计目录不包含 `review.json`。完成草稿后使用 `bpmax-cli test-suite review init` 生成评审骨架;不得手写 `review.json`,已有文件缺字段时使用 `review repair`。
34
+
35
+ ## 用例设计字段
36
+
37
+ 设计阶段至少保留:
38
+
39
+ - `scenario_id`
40
+ - `case_id`
41
+ - `title`
42
+ - `requirement_refs` / `config_basis`
43
+ - `technique`
44
+ - `priority`
45
+ - `preconditions`
46
+ - `test_data`
47
+ - `steps`
48
+ - 每一步的 `expected_result`
49
+ - `postconditions`
50
+ - `coverage_tags`
51
+ - 交付摘要中的 `asset_stage=DESIGNED`(不落入 CSV)
52
+
53
+ 落入现行 `.ai_test` 时,以 `bpmax-e2e-flow-test-operator/references/ai-test-suite.md` 的实际 `README.md`、`cases.csv` 和 `case_steps.csv` 字段为准。设计字段需要映射到 `config_basis`、`type`、`tags`、`expected_result` 和逐步行,不得擅自新增 CLI 不识别的 CSV 列。
54
+
55
+ ## 资产化门禁
56
+
57
+ 1. 先完成目标配置仓库的 latest sync 并生成 `<proof.json>`。
58
+ 2. 将新设计写入 `.ai_test/suite_draft/<scenario_id>/`,状态保持 draft。
59
+ 3. 先运行 lint:
60
+
61
+ ```bash
62
+ bpmax-cli test-suite lint --root .ai_test/suite_draft --scenario <scenario_id> [--scenario <same_flow_scenario_id> ...] --latest-proof <proof.json>
63
+ ```
64
+
65
+ 4. 通过 CLI 初始化或修复评审文件:
66
+
67
+ ```bash
68
+ bpmax-cli test-suite review init --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json>
69
+ bpmax-cli test-suite review repair --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json>
70
+ ```
71
+
72
+ 5. 用户确认、review gate 通过,并显式完成 README 与 case 状态调整后才可 promote。正式库索引使用:
73
+
74
+ ```bash
75
+ bpmax-cli test-suite index --root .ai_test/suite --latest-proof <proof.json>
76
+ ```
77
+
78
+ ## 执行边界
79
+
80
+ - `bpmax-cli test-suite lint` 通过只表示结构和规则检查通过,不表示业务执行通过。带 `--scenario` 时只代表所选流程场景,不代表共享 suite 全部通过。
81
+ - `review init` 只创建评审骨架,不表示评审完成。
82
+ - `promote` 只表示测试资产进入正式库。
83
+ - 真实执行必须使用 `bpmax-e2e-flow-test-operator`,创建 run manifest,并逐步记录浏览器、项目、步骤和读回证据。
84
+ - 未运行工具时,不得编造命令输出、项目 ID、步骤 ID、截图、pass rate 或执行结论。
85
+
86
+ ## 输出摘要模板
87
+
88
+ ```markdown
89
+ 资产阶段:DESIGNED
90
+ 场景:<scenario_id>
91
+ 需求覆盖:<covered>/<total>
92
+ 已采用方法:Domain / Decision Table / State Transition / Use Case
93
+ 尚未完成:latest proof、lint、review、promote、runtime execution
94
+ 下一步:bpmax-cli test-suite lint --root .ai_test/suite_draft --scenario <scenario_id> --latest-proof <proof.json>
95
+ ```
@@ -0,0 +1,50 @@
1
+ # 决策表测试
2
+
3
+ 用于两个及以上条件交互决定审批链、路由、权限、计算结果或系统动作的业务规则。
4
+
5
+ ## 分析步骤
6
+
7
+ 1. 从需求提取条件、条件取值、动作和规则编号;补出明确蕴含的否定条件和拒绝动作。
8
+ 2. 先构造完整决策表:
9
+ - 二值条件共有 `2^n` 个规则;
10
+ - 多值条件的规则数为各取值数的乘积。
11
+ 3. 每列都写出全部动作;空白不能代表不确定。
12
+ 4. 标记不可能组合:
13
+ - 规格直接证明不可能:引用规则并标记;
14
+ - 仅凭测试人员推断不可能:先列为规格缺口,未经确认不得删除。
15
+ 5. 只有当两个规则动作集合完全相同且只差一个条件时,才可合并为 don't-care。
16
+ 6. 验证约简表仍覆盖完整表中的每个有效规则。
17
+ 7. 从约简表派生用例:**一个约简规则对应一个测试用例**。
18
+
19
+ ## 表结构
20
+
21
+ | 条件/动作 | R1 | R2 | R3 | R4 |
22
+ |---|---:|---:|---:|---:|
23
+ | 申请人是经理 | N | N | Y | Y |
24
+ | 金额 > 50000 | N | Y | N | Y |
25
+ | 部门负责人审批 | 待确认 | X | - | - |
26
+ | 财务负责人审批 | 待确认 | X | X | X |
27
+
28
+ 在需求未定义普通员工低金额路径时,保留“待确认”,不要把它约简成直接通过。
29
+
30
+ ## 用例派生规则
31
+
32
+ - 条件转换为前置条件和测试数据。
33
+ - 动作转换为可观察预期,包括节点生成、可处理人、顺序、状态、消息和落库结果。
34
+ - don't-care 必须选择一个最容易暴露错误的具体值,并在用例中说明选择理由。
35
+ - 范围条件的具体数值由 Domain Testing 提供。
36
+ - 为越级操作、未授权操作和未知条件值补充负向用例,但不要伪造需求未定义的结果。
37
+
38
+ ## 完成门禁
39
+
40
+ - 完整决策表已保留或可追溯。
41
+ - 所有不可能规则都有证明或待确认记录。
42
+ - 每次合并都有 don't-care 依据。
43
+ - 每条约简规则映射唯一用例 ID 和业务规则 ID。
44
+
45
+ ## 常见错误
46
+
47
+ - 直接从直觉写约简表,无法证明覆盖完整。
48
+ - 把单字段非法值当成决策表组合;它应交给 Domain Testing。
49
+ - 因“看起来不会发生”删除 API 绕过、数据迁移或并发产生的组合。
50
+ - 合并动作并不相同的规则。
@@ -0,0 +1,43 @@
1
+ # Domain Testing:等价类与边界值
2
+
3
+ 用于字段、参数或输出存在范围、长度、格式、枚举、必填和依赖约束的需求。
4
+
5
+ ## 分析步骤
6
+
7
+ 1. 建立变量清单:变量名、类型、单位、是否必填、规则编号、业务含义。
8
+ 2. 为每个变量划分互斥且完备的等价类:
9
+ - 有效等价类:系统应接受且行为一致的输入集合。
10
+ - 无效等价类:系统应以同一种方式拒绝或处理的输入集合。
11
+ 3. 明确边界包含关系:`>`、`>=`、`<`、`<=` 不得混淆。
12
+ 4. 为每个有序区间选择边界值:
13
+ - 正常 BVA:最小、最小+一步、典型值、最大-一步、最大。
14
+ - 稳健 BVA:再增加最小-一步、最大+一步。
15
+ 5. 对格式和枚举补充结构边界:空值、空白、大小写、字符集、前后缀、精度、非法枚举和未知值。
16
+ 6. 将每个测试值追踪到需求规则和等价类编号。
17
+
18
+ ## 分析表
19
+
20
+ | 变量 | 规则 | 类别编号 | 有效性 | 范围/格式 | 代表值 | 边界值 | 预期 |
21
+ |---|---|---|---|---|---|---|---|
22
+ | amount | BR-01 | EC-A1 | 有效 | 1~100000,含端点 | 60000 | 1、2、99999、100000 | 接受并进入路由判断 |
23
+ | amount | BR-01 | EC-A2 | 无效 | 小于 1 | 0 | 0 | 拒绝提交且不创建流程 |
24
+
25
+ ## 用例派生规则
26
+
27
+ - 每个有效等价类至少一个代表值。
28
+ - 每个无效等价类至少一个代表值,并验证错误文案、状态不变和无副作用。
29
+ - 高风险边界覆盖边界点及两侧相邻值。
30
+ - 多变量组合先由决策表确定组合,再从本表选择具体值;不要计算所有变量的笛卡尔积。
31
+ - 金额、时间、数量等必须写清精度和“一步”的含义,例如 `0.01`、`1 秒`、`1 个`。
32
+
33
+ ## 测试用例字段
34
+
35
+ 写明 `requirement_refs`、`equivalence_class`、`boundary_kind`、具体输入、前置条件、动作、即时预期、最终预期和副作用断言。
36
+
37
+ ## 常见错误
38
+
39
+ - 只测有效值,遗漏无效类。
40
+ - 只测端点,不测端点两侧。
41
+ - 用一个用例同时混入多个无效变量,导致无法定位拒绝原因。
42
+ - 需求没有定义精度或空值行为时自行假定。
43
+ - 只验证提示文案,不验证流程、数据、待办或通知没有被错误创建。
@@ -0,0 +1,47 @@
1
+ # 状态迁移测试
2
+
3
+ 用于系统行为依赖当前状态或历史事件的需求,例如申请、订单、账户、审批任务和子流程生命周期。
4
+
5
+ ## 分析步骤
6
+
7
+ 1. 提取状态、事件、守卫条件、动作、初始状态和终态。
8
+ 2. 先画状态图,标明 `事件 [守卫] / 动作`;自迁移也必须显式表示。
9
+ 3. 再建立完整的 **状态 × 事件** 表:每个状态与每个事件的组合都要有定义。
10
+ 4. 有效单元格写目标状态和可观察动作;无效单元格写拒绝、无操作或错误提示。
11
+ 5. 将未定义单元格报告为规格缺口,不要留空。
12
+ 6. 选择覆盖目标:
13
+ - 全状态覆盖仅适合 smoke;
14
+ - 全有效迁移覆盖是基础;
15
+ - 无效迁移覆盖必须与有效迁移同时考虑;
16
+ - 高风险流程增加连续两次迁移(1-switch)覆盖。
17
+ 7. 设计能覆盖多个迁移的路径,但每一步都写即时预期。
18
+
19
+ ## 状态表
20
+
21
+ | 当前状态 | 事件 | 守卫 | 目标状态 | 动作/预期 | 有效性 | 规则 |
22
+ |---|---|---|---|---|---|---|
23
+ | 草稿 | 提交 | 表单有效 | 已提交 | 创建流程与首个待办 | 有效 | BR-STATE-01 |
24
+ | 已通过 | 撤回 | - | 已通过 | 拒绝撤回且无副作用 | 无效迁移 | BR-STATE-05 |
25
+
26
+ ## 用例派生规则
27
+
28
+ - 每条用例必须写精确起始状态;没有起始状态的用例不可执行。
29
+ - 每一步写事件、守卫数据、预期动作和预期目标状态。
30
+ - 验证状态之外的副作用:待办开启/关闭、权限、历史记录、消息、下游对象和幂等性。
31
+ - 终态的所有禁止事件都应有负向覆盖。
32
+ - 并发或重复事件作为经验补充,不替代状态表覆盖。
33
+
34
+ ## 完成门禁
35
+
36
+ - 状态图先于状态表完成。
37
+ - 表格单元数等于状态数 × 事件数,且无空白行为。
38
+ - 所有状态可达;终态没有未解释的有效出边。
39
+ - 用例标明覆盖的迁移或迁移对。
40
+ - 主路径、驳回路径、撤回路径和禁止路径均按需求状态覆盖。
41
+
42
+ ## 常见错误
43
+
44
+ - 只画合法箭头,不设计无效迁移。
45
+ - 把“开始”伪状态当成可返回的业务状态。
46
+ - 只断言最终状态,不检查中间节点和副作用。
47
+ - 每个迁移拆成孤立用例,遗漏上下文延续问题。
@@ -0,0 +1,38 @@
1
+ # 测试设计方法选择
2
+
3
+ ## 选择表
4
+
5
+ | 需求信号 | 首选方法 | 必要分析工件 |
6
+ |---|---|---|
7
+ | 数值范围、长度、格式、枚举、必填/可选 | 等价类划分 + 边界值分析(Domain Testing) | 变量清单、有效/无效等价类、边界点 |
8
+ | 两个及以上条件共同决定审批、路由、价格、权限或结果 | 决策表测试 | 条件/动作清单、完整决策表、约简表 |
9
+ | 有命名状态,或同一动作因历史不同产生不同结果 | 状态迁移测试 | 状态图、状态 × 事件表、覆盖路径 |
10
+ | 角色通过主流程、备选流程、异常流程实现业务目标 | 用例测试 | 流程清单、场景矩阵、需求追踪矩阵 |
11
+
12
+ 不要根据用户是否说出方法名称来选择;根据需求结构选择。
13
+
14
+ ## 组合规则
15
+
16
+ 复杂 BPMAX 流程通常需要多种方法。固定顺序为:
17
+
18
+ **结构 → 规则组合 → 数据取值 → 经验补充**
19
+
20
+ 1. 先用用例测试或状态迁移确定业务路径。
21
+ 2. 再用决策表展开每个关键节点的条件组合。
22
+ 3. 再用等价类和边界值选择各条件的具体数据。
23
+ 4. 最后补充错误猜测,例如重复提交、并发审批、回调超时、幂等失败和历史缺陷。
24
+
25
+ 错误猜测只能补充,不能替代前述系统化方法。
26
+
27
+ ## 决策示例
28
+
29
+ - “金额必须为 1~100000”:Domain Testing。
30
+ - “普通员工金额大于 50000 需要两级审批,经理只需财务审批”:决策表 + Domain Testing。
31
+ - “草稿→审批中→已通过,已通过禁止撤回”:状态迁移测试。
32
+ - “申请人提交、负责人审批、财务复核、查看终态”:用例测试;流程节点再结合决策表和状态迁移。
33
+
34
+ ## 不适用范围
35
+
36
+ - 需求没有可判定预期:先澄清规格。
37
+ - 编写单元测试或自动化代码:本 skill 只设计测试内容。
38
+ - 性能、安全、兼容性专项:需使用对应专项方法;可复用这里产生的业务路径,但不能宣称专项覆盖完成。