بنقرة واحدة
test-matrix
Build a comprehensive test matrix for changed behavior with explicit assertion strategy per case.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Build a comprehensive test matrix for changed behavior with explicit assertion strategy per case.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | test-matrix |
| description | Build a comprehensive test matrix for changed behavior with explicit assertion strategy per case. |
For each changed unit/function, provide this matrix before coding tests:
## Test Matrix: <unit>
### Case: <descriptive name>
- **Category**: success|boundary|guard|failure|state|determinism
- **Input**: <concrete input values>
- **Expected output**: <exact return value or thrown error>
- **Observable side effect**: <what changes in the world — DB row, file, container state, stdout>
- **Assertion strategy**: <which assertion level from policy-core, and why>
- **Mock boundary**: <what is mocked and why, or "none — real implementation">
Follow the assertion hierarchy and mock rules defined in the policy-core skill.
For each test case, explicitly state HOW you will verify it, preferring Level 1-5 (behavior) assertions over Level 6-7 (wiring) assertions per policy-core:
| If testing... | Assert via... | NOT via... |
|---|---|---|
| Return value | expect(result).toEqual(...) | Mock call args |
| Error thrown | expect(() => fn()).toThrow(ErrorType) | Mock call count |
| Formatted output | expect(formatter.success).toHaveBeenCalledWith("Mecha started") + expect(result.id) | Mock call args alone |
| Docker state | inspectContainer() or integration test | expect(mockCreate).toHaveBeenCalledWith(...) |
| File written | Read file back and verify content | expect(mockWriteFile).toHaveBeenCalled() |
| DB state | Query the DB and verify rows | expect(mockInsert).toHaveBeenCalled() |
| Stream output | Write to stream, collect output, verify content | expect(mockStream.on).toHaveBeenCalled() |
Apply the mock rules from policy-core. Before adding a mock, answer:
If you mock, you MUST also have an integration test (gated behind INTEGRATION=true) that tests the real path.
Validate test strength with mutation testing and harden weak assertions. Covers Stryker (JS/TS), mutmut (Python), go-mutesting (Go), and cargo-mutants (Rust).
Initialize workspace TDD Guardian config and enable strict hooks for test/coverage enforcement.
Enforce coverage thresholds AND test quality — coverage without behavioral assertions is meaningless.
Produce findings-first code review with severity ordering, test-gap findings, and test-quality audit.
Global TDD governance policy. Enforces plan-first development, behavior-driven test quality, and strict completion gates.
Orchestrate strict TDD implementation across planner, implementer, test designer, coverage auditor, mutation auditor, and reviewer subagents.