Laws of Software Engineering · Principle
Principle
Testing Pyramid
Have lots of small fast tests, fewer medium tests, very few big slow tests.
How to use it. When tests are slow and break for the wrong reasons, count the shape. An upside-down pyramid (lots of big slow tests, few small ones) produces the misery you would expect.
How it gets misused. Defended as the only valid shape. Other shapes suit other systems. The pyramid is a strong default and nothing more.
Related
- Practice Test-Driven Development Write the test first. Write only enough code to make it pass. Refactor. Repeat.
- Practice Continuous Integration Every change is merged to a shared trunk at least daily, with automated verification.