Testing Pyramid¶
A healthy testing strategy has many fast tests at the base and few slow tests at the top.
[ End-to-End Tests ] ← few, slow, high confidence
[ Integration Tests ] ← some, moderate speed
[ Unit Tests ] ← many, fast, isolated
The further up the pyramid, the more expensive to write, run, and maintain. Prefer testing at the lowest level that gives you confidence.
Levels¶
→ Unit Tests → Integration Tests → End-to-End Tests
Guidance¶
- Most logic should be covered by unit tests
- Integration tests should cover boundaries between components
- End-to-end tests should cover critical user journeys only — use selectively
- All levels should run automatically in CI