Explanation

The test pyramid and testing trophy explained

When is a unit, integration or end-to-end test the right choice?

Choose the layer that can observe the failure with the least setup and ambiguity. A unit test can isolate a rule, an integration test can expose a broken interaction, and an end-to-end test can show whether a user completes a journey.

What do the two shapes describe?

The test pyramid favours many small checks and fewer full journeys. The testing trophy puts more emphasis on integrated behaviour, especially when a feature’s value lies in several components working together. Both are prompts to examine the work each test does. Neither shape supplies a suitable percentage for every system.

When does a second layer earn its place?

Add a layer when it contributes an observation the first layer cannot make. A price calculation can be correct in isolation while an interface displays the old value. Exercising every discount combination in a browser adds cost, but a focused journey that checks the displayed total answers a separate question.

Worked example

A changed collection slot

Check the scheduling rule with a fixed clock. Exercise the service and database together to confirm the change survives a fresh read. Then use one browser journey to show that the customer sees the revised time. When a check fails, its layer gives the investigator a sensible starting point.

Try it on your pull request

Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.

Try Cue April on your repository