Testing
13 documents
Comprehensive unit testing
Prioritize unit tests over integration tests. Test state transitions, edge cases, serialization round-trips. Every im...
Flaky Test Prevention
Flaky tests destroy confidence. Quarantine them immediately — fix or delete, never ignore.
Mutation Testing
Mutation testing validates that your tests actually catch bugs — not just achieve coverage.
Post-generation verification
Every generated artifact MUST be verified:
Properties of Good Tests
From Kent Beck's Test Desiderata — tests should be:
Property-Based Testing
When to use: parsers, serializers, data transformers, encoders/decoders, validators — anything
References
1. [Google SWE Book Ch. 11: Testing Overview](https://abseil.io/resources/swe-book/html/ch11.html)
Security Testing
Run security scans as part of post-generation verification (agentic-cookbook://guidelines/testing/post-generation-verification). These a...
Test Data
**Construct what you need, per test.** Large shared fixture files SHOULD be avoided.
Test Doubles
Use [Martin Fowler's taxonomy](https://martinfowler.com/bliki/TestDouble.html):
Test Pyramid
Projects SHOULD follow the Google SWE Book ratio: **80% unit / 15% integration / 5% E2E**.
The Testing Workflow
The recommended Claude Code testing workflow, combining all tools:
Unit Test Patterns
**Structure — Arrange, Act, Assert (AAA):**