Failure Path Testing
Prioritize tests that prove the system refuses unsafe progression.
Test Design Workflow
- Identify critical gates where progression must stop.
- Define blocked state fixtures and expected recovery actions.
- Write integration tests that execute realistic command flows.
- Assert both state transitions and user-facing recovery text.
- Add one test per historical regression.
- When a bug spans parsing, persistence, and operator output, cover all three layers in one regression path.
High-Value Negative Paths
- Quality gate fails and blocks social/prep.
- Approval pending and downstream command is rejected.
- Invalid date/week input does not create runs.
- Failed strategy/draft run is not selected as active guidance.
- Malformed input returns file/line or other actionable diagnostics instead of a generic crash.
- Startup/readiness construction failures fail closed before state mutation or service exposure.
- Artifact write failures do not leave partial output behind or replace the good index.
Assertions To Include
- No forbidden artifact written (for example, no final draft).
- Blocking state persisted with diagnostic metadata.
- Recovery command hints are explicit and executable.
- Downstream commands fail deterministically.
- Error text should tell the operator what to fix next, not just what went wrong.
Coverage Heuristic
For each new workflow feature:
- Add at least one happy-path test.
- Add at least one blocked-path test.
- Add one message-clarity assertion for operator recovery.
- If the feature writes files or swaps state, add a regression for the failure point before the swap.
Output Format
When reporting work, include:
- Negative paths added
- Regression cases covered
- Blocking guarantees verified
- Remaining untested gate conditions
High-Signal Patterns
These are the failure paths most often left untested. Reach for this skill when the change touches any of them.
- Malformed or missing configuration, readiness probes, startup guards, and artifact staging.
- Anywhere a pipeline must not advance: after a failed ingest, a failed readiness check, or an unmet gate. The valuable test asserts the non-advance, not the happy path.
- An empty or absent setting value that could silently resolve to a wrong default rather than failing loudly.
- Startup or background-process failures that currently surface as a silent exit rather than a non-zero status.
- Anything a review has already caught once. When a review asks for a fix, write the test around the exact failure mode before the fix — one regression test per exposed mode: an unhandled exception type, a missing CLI option, an unsafe generated filename, a test-environment leak into a live path.