Test Pyramid Variations
Classic pyramid (Mike Cohn)
╱╲ UI tests (few)
╱──╲
╱ Service ╲ (some)
╱──────────╲
╱ Unit tests ╲ (many)
─────────────────
Trophy (Kent C. Dodds)
For frontend-heavy:
╱╲ E2E
╱──╲
╱ Integration ╲ (most)
╱──────────────╲
╱ Unit + Static ╲
────────────────────
Integration tests give best ROI for FE — closer to user behavior.
Honeycomb (Spotify)
For microservice:
/────\
╱ Integrated tests ╲ (most)
\────/
/────\
/ Implementation │
\ Detail tests / (few)
Focus on integration between services > unit within service.
Anti-patterns
Ice-cream cone
╱──────────╲
╱ UI tests ╲ (70%)
╲──────────╱
╱ Integration ╲ (20%)
\──────────/
\ Unit / (10%)
\/
Result: slow, flaky, expensive. Often from outsourcing QA team isolated from dev.
Hourglass
- Lots of unit + lots of E2E.
- Few integration → integration bugs slip through.
Cup cake
- Lots of unit at bottom.
- Spike of manual at top.
- No middle layer.
Choose your shape
Depends on:
- App architecture (monolith, microservice, FE-heavy).
- Team maturity.
- Tool ecosystem.
VN context
Most mid-startup default to classic pyramid. Frontend-heavy app (e-com, edtech) often shift to trophy.