Testing

13 documents

Comprehensive unit testing

Prioritize unit tests over integration tests. Test state transitions, edge cases, serialization round-trips. Every im...

csharppythontypescript

Flaky Test Prevention

Flaky tests destroy confidence. Quarantine them immediately — fix or delete, never ignore.

typescriptweb

Mutation Testing

Mutation testing validates that your tests actually catch bugs — not just achieve coverage.

csharpkotlinpythonswifttypescript

Post-generation verification

Every generated artifact MUST be verified:

ioskotlintypescript

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

csharpkotlinpythonswifttypescript

References

1. [Google SWE Book Ch. 11: Testing Overview](https://abseil.io/resources/swe-book/html/ch11.html)

typescriptweb

Security Testing

Run security scans as part of post-generation verification (agentic-cookbook://guidelines/testing/post-generation-verification). These a...

csharpkotlinpythonswifttypescriptweb

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):

csharpkotlinpythonswifttypescriptweb

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:

pythonswifttypescriptweb

Unit Test Patterns

**Structure — Arrange, Act, Assert (AAA):**