Mike Cohn's original test pyramid consists of three layers that your test suite should consist of (bottom to top):
1.Unit Tests 2.Service Tests 3.User Interface Tests
- Write tests with different granularity
- The more high-level you get the fewer tests you should have
Your unit tests make sure that a certain unit (your subject under test) of your codebase works as intended
All collaborators (e.g. other classes that are called by your class under test) of your subject under test should be substituted with mocks or stubs to come up with perfect isolation and to avoid side-effects and a complicated test setup
Tests that allow talking to real collaborators
Only collaborators that are slow or have bigger side effects (e.g. classes that access databases or make network calls) should be stubbed or mocked
