Testing pyramid
The testing pyramid is a software-testing heuristic that recommends many fast, narrow-scope tests and progressively fewer, broader, slower tests at higher levels.
Unit Testing Principles, Practices, and Patterns
The Test Pyramid is a testing strategy that recommends a relative distribution of unit, integration, and end-to-end tests, with more tests in lower layers.
- How it is used
- Balances fast feedback, regression protection, refactoring resistance, and maintenance cost when allocating test types.
- How deep it goes
- Defines the three-layer ratio and allocation rules, but leaves the exact mix to project complexity.
- Examples
- Uses pyramid layers, business-scenario edge cases, happy paths, controllers, domain models, databases, and dependency boundaries.
- What you can do after
- Apply it by shifting edge-case coverage toward unit tests and reserving integration tests for system-level paths and uncovered cases.
Read how Unit Testing Principles, Practices, and Patterns explains testing pyramid →
Contract Testing in Action
The test automation pyramid is a model that recommends distributing automated tests across unit, integration, and end-to-end layers, with fewer tests at slower and more expensive higher layers.
- How it is used
- Guides teams toward balanced automated-test coverage by matching test scope with feedback speed, isolation, integration confidence, and user coverage.
- How deep it goes
- Defines three layers, adds contract testing between unit and integration tests, and contrasts the model with the ice cream cone anti-pattern.
- Examples
- Uses login validation, authorization, service slowdown, cookie sessions, and contrasting pyramid and ice cream cone diagrams.
- What you can do after
- Evaluate automated-test placement and distribute failures across unit, contract, integration, and end-to-end checks.
Read how Contract Testing in Action explains testing pyramid →
Shipping Go: Develop, deliver, discuss, design, and go again
A testing pyramid is a testing strategy with many fast unit tests at the base and progressively fewer broader, more expensive tests above them.
- How it is used
- Guides automated quality checks by concentrating feedback near the code and expanding coverage toward integrated system behavior.
- How deep it goes
- Explains test layers, sequencing, cost, determinism, and practical starting points, but stops short of full-system UI-to-API implementation.
- Examples
- Uses deterministic balance and error-rate calculations, mocked dependencies, database integration, service integration, load testing, and full-system workflows.
- What you can do after
- Apply via automated unit tests first, then add integration and end-to-end checks in progressively smaller, later-running layers.
Read how Shipping Go: Develop, deliver, discuss, design, and go again explains testing pyramid →
Django in Action
A testing pyramid is a model that organizes software tests into levels based on scope, speed, and execution cost.
- How it is used
- Organizes automated tests into categories that separate component checks from cooperation, requirements, and interface checks.
- How deep it goes
- Defines unit, integration, and behavioral testing, then notes UI testing without detailing its implementation.
- Examples
- Uses a testing-category figure, single-function tests, database writes, Cucumber, and Django UI testing as concrete reference points.
- What you can do after
- Evaluate which testing level matches a component, interaction, requirement, or user-interface concern.
Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform
The testing pyramid is a model that organizes tests into layers, with broader and generally slower tests placed above narrower and generally faster tests.
- How it is used
- Guides automated test-suite composition for microservices and provides fast feedback before deployment.
- How deep it goes
- Defines three testing levels, their relative quantities, interfaces, and tools, but does not detail test implementation beyond these practices.
- Examples
- Uses isolated functions, whole microservices, HTTP or message interfaces, and a Docker Compose application tested through a frontend.
- What you can do after
- Apply via Jest, Docker Compose, Playwright, and CI/CD to build layered automated tests with rapid local feedback.
Build Financial Software with Generative AI (From Scratch)
A testing pyramid is a model that organizes software tests by scope, with numerous fast isolated tests at the base and fewer slower broader tests toward the top.
- How it is used
- Guides developers toward a broad base of fast isolated tests and a smaller set of slower broader checks.
- How deep it goes
- Defines major layers and their trade-offs, but defers additional testing categories and fuller breakdowns.
- Examples
- Uses a FastAPI GET /files endpoint, TestClient assertions, a BDD feature, and pytest-bdd step definitions.
- What you can do after
- Apply it via FastAPI TestClient and pytest-bdd while choosing test scope according to isolation, speed, dependencies, and fragility.
Read how Build Financial Software with Generative AI (From Scratch) explains testing pyramid →
Think Like a Software Engineering Manager
The testing pyramid is a test-suite design framework that emphasizes an appropriate distribution of automated tests across testing levels.
- How it is used
- Guides automated test-suite design and regression protection before engineering changes reach users.
- How deep it goes
- Defines three testing levels and their pyramid positions, but does not provide implementation details or distribution ratios.
- Examples
- Uses a three-level pyramid figure, commit-triggered tests, and Netflix Chaos Monkey as testing-automation examples.
- What you can do after
- Apply it by building repeatable automated tests and integrating them into the development workflow.
Read how Think Like a Software Engineering Manager explains testing pyramid →
gRPC Microservices in Go
The testing pyramid is a test-distribution model that places isolated unit tests below integration tests and end-to-end tests, with progressively fewer tests and greater execution cost at higher levels.
- How it is used
- Guides the distribution of microservice tests to balance fast feedback, application-flow confidence, and testing infrastructure cost.
- How deep it goes
- Defines three test levels and explains their isolation, dependencies, execution speed, and cost, but does not prescribe exact percentages.
- Examples
- Uses an Order service, mocked dependencies, a real database, test containers, and complete application flows as testing examples.
- What you can do after
- Apply it to arrange unit, integration, and end-to-end suites for faster feedback while preserving cross-component verification.
Read how gRPC Microservices in Go explains testing pyramid →
Also covered in
- Java Persistence with Spring Data and Hibernate epub
- Retrieval Augmented Generation, The Foundational IdeasIn early access (MEAP)
- Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform
- Data-Oriented Programming in JavaIn early access (MEAP)
- Practices of the Python Pro
- 100 Go Mistakes and How to Avoid Them
What to know first
- software testingSoftware testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
- end-to-end testingEnd-to-end testing evaluates a complete system workflow across integrated components, from an external entry point to its observable outcome.
- deployment pipelineA deployment pipeline is a repeatable sequence of stages that builds, tests or validates, packages, and delivers software changes toward release or deployment.
- integration testAn integration test evaluates whether multiple software components, or a component and an external dependency, interact and behave correctly together.
Related concepts
- integration testhas part · An integration test evaluates whether multiple software components, or a component and an external dependency, interact and behave correctly together.
- software testinghas part · Software testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
- end-to-end testinghas part · End-to-end testing evaluates a complete system workflow across integrated components, from an external entry point to its observable outcome.
- unit testhas part · A unit test is an automated test that checks whether a relatively small unit of software behaves as expected, typically in isolation from external dependencies.
- acceptance testinghas part · Acceptance testing evaluates whether a system satisfies specified user, business, or stakeholder requirements and acceptance criteria.
Questions about testing pyramid
What is testing pyramid?
The testing pyramid is a software-testing heuristic that recommends many fast, narrow-scope tests and progressively fewer, broader, slower tests at higher levels.
Which Manning books explain testing pyramid?
Unit Testing Principles, Practices, and Patterns, Contract Testing in Action, Shipping Go: Develop, deliver, discuss, design, and go again, Django in Action, Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform, Build Financial Software with Generative AI (From Scratch), Think Like a Software Engineering Manager and gRPC Microservices in Go.
What should I know before learning testing pyramid?
Manning books that teach testing pyramid usually introduce software testing, end-to-end testing, deployment pipeline and integration test first.
What is the difference between testing pyramid and ice cream cone of test automation?
The testing pyramid is a software-testing heuristic that recommends many fast, narrow-scope tests and progressively fewer, broader, slower tests at higher levels. The ice cream cone of test automation is an anti-pattern in which a test suite contains many end-to-end or UI tests, fewer integration tests, and fewer unit tests, often alongside substantial manual testing.
What are the parts of testing pyramid?
Testing pyramid includes integration test, software testing, end-to-end testing, unit test and acceptance testing.
What is testing pyramid also called?
Testing pyramid is also called test pyramid.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







