Use the testing pyramid to decide which checks should run at each scope—not to hit a mandatory test-count ratio. Put isolated, deterministic behavior in fast unit tests, add integration tests for important boundaries, and reserve end-to-end tests for a small set of critical user journeys. In CI, run the fastest reliable checks first and widen the scope as the pipeline progresses.
What the testing pyramid means
The testing pyramid is a way to balance feedback speed and confidence across automated tests. Its traditional shape has many small unit tests at the base, a substantial but smaller integration layer in the middle, and relatively few broad end-to-end tests at the top. Martin Fowler describes the central idea as having many more low-level unit tests than broad-stack tests: end-to-end checks tend to take longer and cost more to create and maintain, and can be more brittle or nondeterministic. The pyramid is a heuristic, not a rule that every test suite must have a particular shape. Fowler’s Practical Test Pyramid also notes that higher-level tests can be worthwhile when they are fast, reliable, and inexpensive to change.
As an Amazon Associate I earn from qualifying purchases.
Teams use terms such as “unit” and “integration” differently. Agree on what scope and dependencies each label means in your project before using test names to make pipeline decisions. The popular “Test Automation Pyramid” terminology is associated with Mike Cohn’s Succeeding with Agile; Fowler traces its earlier development to conversations around 2003–04 and notes that Jason Huggins arrived at a similar idea independently around 2006. Fowler’s history and explanation provide further context.
Choose tests by scope and the confidence they add
Unit tests: isolated behavior and edge cases
Use unit tests for focused behavior that can be exercised without bringing up a broad environment: calculations, decision logic, validation rules, and boundary cases. Their failures should point toward a small part of the code, making diagnosis and feedback quick. Google’s testing guidance describes small tests as faster and more reliable, while emphasizing the importance of isolation, including hermetic tests. Google’s test-size guidance explains the distinction.
Use a fake or other test double when it keeps the test focused, but maintain it as a model of the real dependency rather than letting it drift. Use the real dependency when the behavior under test is specifically about that dependency or its contract. A test that passes against an inaccurate fake can create false confidence.
Integration tests: important boundaries and interactions
Integration tests check that a small group of units or dependencies work together. They help find problems at boundaries—such as how one component communicates with another—without requiring the full end-to-end environment. Google argues against skimping on this middle layer: “As a result, integration tests, with smaller environments to bring up, will be faster and more reliable than the full end-to-end tests with their full set of dependencies.” Google’s “How Much Testing is Enough?” discusses the role of integration tests.
An hourglass-shaped suite—with many unit tests, very few integration tests, and a large end-to-end layer—can leave ordinary component interactions to be verified only through expensive full-stack checks. Add integration coverage where the interaction itself matters, rather than assuming unit tests on either side prove the boundary works.
End-to-end tests: a small number of critical journeys
Use end-to-end tests for complete, important user workflows that need confidence across a broad stack. Google calls these Critical User Journeys (CUJs). Choose journeys that represent meaningful user goals; do not repeat every branch and edge case already tested more cheaply below. Google’s guidance on test sufficiency explains CUJs and test scope.
A user interface does not automatically make a test high-level. A UI behavior can sometimes be tested narrowly, with few dependencies. Classify tests by scope and what they depend on, not just by whether a browser or interface appears in the test.
Build the balance around your risks
- List behaviors and risks. Separate isolated logic, component boundaries, and complete workflows. Identify which failures matter and what evidence would catch them.
- Cover isolated behavior with focused tests. Add deterministic unit tests for core logic and edge cases. Keep dependencies out unless they are part of the behavior being verified.
- Test important interactions at their boundary. Add integration tests for component and dependency combinations that can fail independently of either component in isolation.
- Select critical user journeys. Keep end-to-end tests focused on essential workflows where broad, realistic coverage adds distinct confidence.
- Order CI by feedback cost. Put fast, narrow, reliable checks early; schedule broader or slower checks later. Place tests by their actual scope and runtime, not mechanically by their label.
- Turn broad-test discoveries into focused regressions. When an end-to-end test finds a defect, add a lower-level regression test if that level can reproduce it. Keep the broad test when it still validates a distinct journey or boundary.
- Review the suite’s costs and gaps. Look at runtime, flaky failures, maintenance effort, resource use, and how closely tests reflect production conditions. Remove overlapping checks that add cost without distinct confidence.
Martin Fowler’s advice for pipeline design is succinct: “A good build pipeline tells you that you messed up as quick as possible.” The Practical Test Pyramid discusses this feedback goal. It does not mean every check must block every deployment; choose the sequence and gates that fit the consequences of a failure and the way your team ships.
Should you aim for a 70/20/10 split?
Google’s Testing Blog offered 70% unit, 20% integration, and 10% end-to-end as “a good first guess,” while also saying the right mix differs by team. That is guidance from the Google Testing Blog in 2015, not a universal standard or an empirical promise that a suite will become faster. Google’s article on avoiding excessive end-to-end tests is the source of the suggestion.
Recommended Free Tools
Use the ratio only as a prompt to inspect your balance. A service with important dependency contracts may need more integration coverage; a product with a few especially consequential workflows may justify selected end-to-end checks. The useful question is whether each test catches a risk reliably and at an appropriate cost—not whether the test-count chart resembles a pyramid.
Measure the trade-offs, not just test counts
For each layer, consider the time to get feedback, the reliability and diagnosability of failures, the maintenance and resource cost, and the fidelity to real dependencies and operating conditions. Google’s 2024 SMURF framework summarizes five relevant qualities: Speed, Maintainability, Utilization, Reliability, and Fidelity. These properties can trade off: a broad test may better approximate production, while a smaller test is often faster and cheaper. Google’s SMURF article describes the framework.
Rank #4
- Slow tests: identify setup, shared state, unnecessary dependencies, and repeated scenarios before moving checks or deleting them.
- Unreliable tests: investigate timing assumptions, external services, shared mutable data, and environmental differences. Isolation and hermetic execution can improve repeatability.
- Hard-to-diagnose failures: narrow the test’s scope or add focused coverage at the level that can pinpoint the behavior.
- Duplicated coverage: retain overlapping tests only when they establish meaningfully different confidence, such as a boundary contract or a complete user journey.
- Missing risk coverage: functional test layers do not replace performance, load, fault-tolerance, security, accessibility, localization, privacy, or usability testing.
There is no supported percentage by which adopting a pyramid will speed up a team’s suite. The improvement depends on the suite’s existing bottlenecks and on whether changes reduce expensive, redundant, or unreliable checks without weakening coverage.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common shapes that slow feedback
The ice-cream cone
A suite dominated by broad end-to-end UI tests can make feedback slower, maintenance heavier, and failures harder to localize. Move reproducible logic and boundary checks to smaller scopes where they still exercise the relevant behavior; preserve end-to-end tests for the journeys that need full-stack evidence.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsThe hourglass
A large unit layer plus broad end-to-end tests, with too few integration tests, leaves a gap around ordinary component interactions. Add middle-layer tests for the boundaries that matter instead of asking the full environment to verify every interaction.
Best Value
The rigid pyramid
Chasing a fixed distribution can create tests that exist to satisfy a chart rather than reduce risk. A fast, dependable higher-level test may be a better choice than a costly or artificial lower-level one if it is the clearest way to verify the behavior.
ScreenshotNeo is not a test-suite tool
ScreenshotNeo is a website screenshot API and MCP server, not a testing pyramid or automated test framework. Its relevance is limited to workflows that need website screenshots or PDFs: developers can call its API, or AI agents can use its MCP server tools. Learn more at ScreenshotNeo.
Frequently Asked Questions
Will following the testing pyramid guarantee a faster test suite?
No. It is a heuristic for balancing feedback speed and confidence; the result depends on your suite’s existing costs and bottlenecks.
Does the testing pyramid replace performance or security testing?
No. Unit, integration, and end-to-end layers address functional behavior; they do not replace nonfunctional testing such as performance, security, accessibility, or privacy checks.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




