Why your test suite is slow, flaky, and expensive.
Author:Sambath Kumar Natarajan(Connect)Version:1.0
The Test Pyramid vs The Ice Cream Cone
The Ideal (The Pyramid)
Proposed by tracking Mike Cohn.
- 70% Unit Tests: Fast (ms). Deterministic. Cheap.
- 20% Integration: Test db/api boundaries. Slower (s).
- 10% E2E (UI): Test user flows. Slow (m). Flaky. Expensive.
The Reality (The Ice Cream Cone)
Most organizations have:
- 0% Unit: "Too hard to mock things."
- 10% Integration: "We don't have environments."
- 90% E2E (Selenium/Cypress): "Just record what the user does."
Why The Cone Kills Velocity
- Flakiness: E2E tests fail 10% of the time due to network bloops, not bugs.
- Duration: A suite of 500 Selenium tests takes 4 hours. Developers stop running them.
- Debugging: When an E2E test fails, you know "It didn't click the button," but you don't know why.
The Fix: Invert the Pyramid
Delete your E2E tests.
- Radical? Yes.
- If a test is flaky, it provides negative value. It erodes trust.
- Replace 1 E2E test with 20 Unit tests and 2 Integration tests.
