22.1 · The pyramid, and what not to test

A test suite is an investment with running costs. The goal is the most confidence per minute of waiting and per hour of maintenance, which means choosing the cheapest kind of test that can catch each kind of bug.

Mental model. Push each check as low as it can go: logic in fast unit tests, wiring in a few integration tests, and only the critical journeys in slow UI tests.

Shape and scope

The layers of tests, their costs, and what is not worth a test.

  1. What is the test pyramid for an iOS app, and what does each layer cost and catch? 22.1.1 · L2
    The pyramid is a rule of thumb about proportion: many fast, narrow tests at the bottom, fewer broad ones above. Unit tests exercise one type or function in…
  2. What should you not test, and how do you decide whether a test is worth having? 22.1.2 · L3
    A test is worth having if it fails when behaviour users or other code depend on breaks, and stays quiet when you refactor. By that standard a lot of tests are…

More in Testing