--- description: testing principles as proof of delivery claims globs: alwaysApply: true --- # Governance: Testing ## Core Testing Principle Tests are proof of claims, not ceremony. Each important claim should map to verifiable evidence. ## Test Design Standards - prefer behavior-focused tests over implementation-detail tests - include success and failure paths - include edge cases for high-risk logic - keep tests deterministic and repeatable ## Testing Layers (use what fits scope) - **Unit**: isolated logic correctness - **Integration**: component boundaries and contracts - **End-to-end**: user-critical workflows - **Regression**: prevent behavior drift Not every change needs every layer, but critical paths must be covered. ## Test-to-Intent Traceability For governed delivery, link tests back to: - OpenSpec requirement IDs, - acceptance criteria, - or explicit behavior statements. OpenSpec-first rule: - if required behavior is not represented in OpenSpec, add/update requirement IDs before marking coverage complete. ## Execution Expectations - run targeted tests during iteration - run appropriate regression checks before completion - capture failing output when blocked - avoid marking complete without evidence ## Test Quality Anti-Patterns - flaky tests accepted as "good enough" - broad snapshot assertions without intent - coverage metrics used without behavioral relevance - tests that pass but do not prove the requirement