Quality

The test pyramid in practice

Many fast unit tests, fewer integration tests and a handful of end-to-end tests. How to apply the test pyramid to a modern web or mobile product.

GloryTekSystems team21 Aug 2026 2 min read

An engineer working on code in a contemporary office

The test pyramid, popularised by Mike Cohn in 2009, is a simple guide to balancing automated tests: many small, fast tests at the bottom, fewer broader tests above them and only a few slow end-to-end tests at the top. Teams that invert it, relying mostly on end-to-end tests, end up with slow, fragile suites nobody trusts.

Unit tests

Test business logic in isolation: calculations, validation and state changes. They run in milliseconds, pinpoint failures precisely and should make up most of the suite. Aim them at code with real logic, not trivial getters.

Integration and API tests

Test that components work together: an API endpoint with its database, a service with its message queue, your code with a third-party sandbox. They catch configuration and contract problems unit tests miss, and remain fast enough to run on every change.

End-to-end tests

Drive the real interface through critical journeys: sign-up, search, checkout and payment. Keep them few and stable, because each one is slow and touches everything.

Signs your balance is off

  • The suite takes too long to run before every merge
  • Tests fail at random and get re-run until they pass
  • Bugs reach production in logic a unit test could have caught
  • Nobody knows what a failing test is checking
Written by the GloryTekSystems team

Our engineers and consultants write about what they see in real projects. Have a question about your own systems?

Ask us
GloryTek assistantQuick answers · automated

Hi, I’m the GloryTek assistant. Ask me about our services, pricing, timelines or industries.

Popular pages

↑↓ to move to open Esc to close