In the test pyramid, which tests should you have the most of?
Options
- End-to-end UI tests in the browser
- Manual exploratory tests by testers
- Fast, isolated unit tests of functions (Correct option)
- Load and stress tests under traffic
Answer
Fast, isolated unit tests
Why
The test pyramid: a wide base of many small, fast unit tests; a middle layer of integration tests (several parts together, e.g. code + database); a small top of end-to-end tests (the whole app, like a real user).
Unit tests run in milliseconds and point exactly to the bug. End-to-end tests are slow and fragile, so keep only a few for critical paths.
Remember
Many unit tests, some integration tests, few end-to-end tests.