Testing · Senior · Question 1 of 75
How do you decide where to place a test in the pyramid/trophy?
- ✓Correct answer: At the lowest level that can still catch the failure you care about with enough confidence
- 2Always at the E2E level, because it's closest to the user
- 3Always at the unit level, because it's the fastest
Explanation
If a bug can be caught by a unit or integration test, a duplicate E2E test only adds cost. E2E is for what lower levels can't see: real wiring, deployment, third-party integrations.