Glossary

Test Pyramid

What is Test Pyramid?

The test pyramid, introduced by Mike Cohn and popularised by Martin Fowler, is a visual model for distributing automated test effort. The three layers in mobile: Unit tests (fast, isolated, no device required, business logic, parsers, formatters), Integration tests (moderate speed, test component boundaries, database queries, network layer, ViewModels), and UI/E2E tests (slow, device-dependent, test full user flows). The pyramid shape represents the recommended proportion: many units, fewer integrations, fewest E2E tests. Inverting the pyramid, many E2E tests, few units, is the 'ice cream cone' anti-pattern: expensive to run, slow to fail, hard to debug.

Test Pyramid, frequently asked questions

Unit tests (bottom): fast, isolated logic tests with no device. Integration tests (middle): tests that cross component or layer boundaries, database, API client, ViewModel. UI/End-to-End tests (top): full-app tests on simulator or real device that exercise complete user flows. The pyramid recommends investing most effort in the bottom layer and least in the top.