FOUNDATIONSCHAPTER 02

Testing philosophies: pyramid, trophy, exploratory, risk-based

Four answers to four different questions: how to spread automated checks by cost, which checks buy the most confidence, how to find what nobody thought to check, and where to spend hours you do not have. Know what each assumes before you adopt it

40 MINQA AND QUALITY ENGINEERINGUPDATED 2026-11-05
PREDICT

A team has thousands of unit tests, high coverage and no tests that cross a service boundary. A bug escapes where the mobile app and the quote service disagree on the unit of an amount. Which test would have caught it most cheaply?

Every team that tests has a philosophy, whether or not it has a name for it. Some inherited theirs from a conference talk, some from the framework’s documentation, some from the last incident. The four you will hear about most are the test pyramid, the testing trophy, exploratory testing and risk-based testing. They are often argued about as rivals. They are not. They answer different questions, and most of the arguments between their followers come from people answering different questions and thinking they disagree.

This chapter gives each one a fair hearing: what it says, where it came from, what it assumes, and where it fails. By the end you should be able to look at a product and sketch the shape of testing it needs, and defend that shape to an engineer who believes in a different one.

What testing can and cannot tell you

Start with the limit, because every philosophy is a response to it. In the discussion recorded in the report of the 1969 NATO conference on software engineering techniques in Rome, Edsger Dijkstra put it in nine words: “Testing shows the presence, not the absence of bugs.” His paper in the same report, “Structured programming”, says it at more length: the number of possible inputs to a real program is so high that “demonstration of correctness by sampling is completely out of the question.”

Dijkstra’s conclusion was that you should prove programs correct instead. Most of industry did not follow him there, but his premise stands. A test is a sample. A passing suite tells you that the cases someone chose behave as expected. It tells you nothing about the cases nobody chose. So the real questions are which samples to take, at what cost, and how to find the cases nobody thought of.

The four philosophies divide that work:

Philosophy The question it answers What it optimises
Test pyramid How should automated checks be spread across levels? Cost and speed of feedback
Testing trophy Which automated checks give the most confidence? Confidence per test
Exploratory testing How do we find what nobody thought to check? Discovery of the unknown
Risk-based testing Where should limited time go? Harm avoided per hour

The first two are about automation. The third is about human investigation. The fourth is about allocation, and it sits above the other three: it tells you how much of each to do.

The test pyramid

What it says. Write many small, fast unit tests, fewer integration or service tests, and very few end-to-end tests that drive the whole system through its user interface. Mike Cohn popularised the shape as the “test automation pyramid” in his 2009 book Succeeding with Agile; Martin Fowler’s 2012 note on it, in the reading, records that Cohn first sketched it in conversation with Lisa Crispin years earlier. Fowler’s summary of the problem it solves is that tests running end-to-end through the UI are “brittle, expensive to write, and time consuming to run.” Ham Vocke’s 2018 article “The Practical Test Pyramid” is the long-form version, with code, and its main advice is to push each test as low in the pyramid as it can go.

Why it was right. In 2009 the common shape was the reverse: a large manual regression suite, a layer of recorded UI scripts, and few unit tests. People call that the ice-cream cone. It produced builds that took hours, tests that failed for reasons unrelated to the change, and teams that stopped trusting red. The pyramid fixed that by moving checks to where they are cheap and deterministic. A unit test that fails points at a function. An end-to-end test that fails points at the whole system.

Where it fails. Three places.

First, “unit” has no agreed meaning. To one engineer it is a single function with every collaborator mocked. To another it is a small cluster of classes that do one job. Pyramid-by-number pushes teams towards the narrow definition, and narrow unit tests full of mocks check that the code calls its collaborators the way the code calls its collaborators. They break on every refactor and pass when behaviour is wrong.

Second, the pyramid assumes most defects live inside units. In a system of many small services, a lot of the logic lives in the wiring: serialisation, retries, timeouts, the order in which two services are called. The bug in the Why lived there. So do most of the bugs in the idempotency and retries lessons.

Third, the pyramid gets turned into a ratio. A split such as 70/20/10 is a common rule of thumb and a poor target. The shape was meant to describe cost, not to prescribe a percentage.

The trophy and the honeycomb

What it says. Kent C. Dodds drew the testing trophy for JavaScript applications: a base of static analysis (types and linting), a thin layer of unit tests, a large middle of integration tests, and a small cap of end-to-end tests. The idea grew from a 2016 line by Guillermo Rauch, “Write tests. Not too many. Mostly integration.”, which Dodds expanded into a post. His guiding principle, quoted in his 2021 article in the reading, is that “the more your tests resemble the way your software is used, the more confidence they can give you.”

Spotify’s engineering blog described a similar shape for microservices in 2018, the testing honeycomb: mostly integration tests that exercise a service through its real interface with its real database, few tests of implementation detail, and ideally none of what they call integrated tests, tests that pass or fail depending on whether another team’s service is up.

Why it is right. Tooling changed the cost curve the pyramid was drawn on. A component test that renders a real component in a simulated browser, or a service test that starts a real database in a container, now runs in seconds rather than minutes. When a broader test costs nearly as little as a narrow one and catches more, write the broader one. Static types also remove a whole class of bug that teams once wrote unit tests to catch.

Where it fails. Integration tests multiply combinations. A function with eight branches is easy to cover with unit tests and painful to cover through an API. Code that is mostly algorithm, a fee calculation, a currency rounding rule, a parser, still wants dense unit tests, and Dodds says as much: he gives his small open-source libraries full coverage because a bug there spreads to every user. The trophy also assumes fast integration tooling. On a legacy stack where starting the database takes four minutes, it is the ice-cream cone again.

Notice that the pyramid and the trophy agree on more than they disagree. Both say end-to-end tests should be few. Both say feedback should be fast. They disagree about what a “unit” is and where the middle of the effort should sit, and the right answer depends on where your logic lives.

Exploratory testing

What it says. A tester designs and runs tests at the same time, using what the last test revealed to choose the next one. Cem Kaner named the practice in the 1980s; Elisabeth Hendrickson’s Explore It! is the practical guide, and James Bach and Michael Bolton built Rapid Software Testing around it. It is not unstructured clicking. Good exploration has a charter (what to explore, with what resources, to find what information), a time box, usually 60 to 120 minutes, and session notes that record what was covered and what was found. Bach’s session-based test management is the reporting method. The Exploratory testing and charters chapter later in this track covers the mechanics.

Why it is right. Every automated check encodes a prediction. Someone thought “this might break” and wrote it down. Exploratory testing is how you find the failures nobody predicted: the transfer that succeeds twice when the user taps back during a slow network call, the SMS that splits into three parts because a recipient’s name has an emoji. In the language of Dijkstra’s limit, it is how you choose samples nobody else would have chosen.

Where it fails. It does not repeat itself, so it cannot guard against regressions; a finding worth keeping has to be turned into an automated check. It depends heavily on the skill of the person doing it, which makes it hard to plan and easy for a manager to cut. Its output is a set of notes rather than a pass rate, and organisations that run on dashboards struggle to value it. And it is sometimes used as a label for testing with no plan at all, which earns it a bad name it does not deserve.

Risk-based testing

What it says. You will never have time to test everything, so rank what could go wrong by likelihood and impact, and spend effort in proportion. James Bach’s 1999 article “Heuristic Risk-Based Software Testing” is the clearest early statement; the ISTQB syllabus formalises the same idea with a risk register and a likelihood-by-impact matrix. A risk-based plan reads like a list: “Payout to the wrong account: low likelihood, catastrophic impact, test at every level and explore every release. Profile photo upload fails: medium likelihood, low impact, one end-to-end check.”

Why it is right. It is the only one of the four that tells you what not to test, and that is most of the job. It connects testing to the business: a risk ranked by impact is a sentence a product manager or a head of engineering can argue with, where a test count is not. It also tells you which of the other three philosophies to use where.

Where it fails. The likelihood numbers are usually guesses, and guesses lean towards the last incident. The register only contains risks someone imagined, so it shares the automated suite’s blind spot, which is why it needs exploration beside it. And it can be used to justify not testing: “low risk” is a convenient label for a feature nobody wants to test. Write down who rated each risk and revisit the ratings after every escaped defect.

Coverage, and what it cannot tell you

Coverage is the number every philosophy gets measured with, so you need to know its limits. Line coverage tells you which lines ran during the tests. It does not tell you whether any test checked what those lines produced. A test with no assertions raises coverage.

Google’s 2020 testing-blog post on coverage gives rough internal guidelines and, in the same breath, declines to mandate any of them. Dodds argues that past about 70% the returns from each extra point fall fast. Both are rules of thumb from practitioners, not laws.

Two better uses of coverage. Read the uncovered lines in code review: what is not covered is more informative than the total. And if you want to know whether tests check anything, use mutation testing, which changes the code on purpose and sees whether a test fails. A suite with 95% coverage and a mutation score of 40% is running code, not testing it. The quality metrics chapter in the Lead module reads the Google post in detail and covers what to do when leadership wants coverage as a target.

Sketching a test shape

A test shape is a one-page answer to “what kinds of testing, in what proportion, for this product, and why.” To sketch one, ask four questions.

  1. Where does the logic live? Inside functions (algorithms, calculations, rules), at the seams (APIs, queues, third parties), or in the interface (layout, flows, accessibility)? Dense unit tests for the first, integration and contract tests for the second, component tests and exploration for the third.
  2. What does a defect cost, and to whom? A wrong payout is money lost and a regulator interested. A misaligned button is a support ticket. The payment ledger lesson shows why money systems get reconciliation checks that most products never need.
  3. How fast must feedback be? A team deploying twenty times a day needs a pre-merge suite that runs in minutes. A team shipping a mobile app every two weeks can afford a longer release gate.
  4. What can only be found in production? Load, real third-party behaviour, real devices. That is the job of synthetic checks and canaries; the synthetic monitoring chapter covers the mechanism.

Different answers produce different shapes, and that is the point:

Product Where the logic lives Shape that fits
Fee and FX calculation library Inside functions Pyramid: dense unit and property-based tests
React web dashboard Interface and API calls Trophy: static types, component integration tests, a few E2E flows
Service in a mesh of twenty At the seams Honeycomb: service tests with a real database, contract tests per consumer
New feature, unclear requirements Unknown Exploration first, automation once behaviour settles

Where practitioners disagree

You will meet strong opinions. Know what each one is reacting to.

The pyramid camp has been burned by slow, flaky UI suites and a team that stopped trusting the build. The trophy camp has been burned by thousands of mocked unit tests that broke on every refactor and caught nothing. The context-driven school, Bach, Bolton and Kaner among them, has been burned by organisations that treated test cases as the whole of testing and measured testers by cases executed; Bach and Bolton draw a line between checking, which a machine can do, and testing, which needs a person. The risk camp has been burned by plans that spread effort evenly and left the dangerous paths as thin as the trivial ones.

Each is right about the failure it saw. A mature strategy borrows from all four: risk-based allocation on top, a shape of automation chosen by where the logic lives, and scheduled exploration for what the automation cannot predict.

Day to day

At Test Analyst or QA Analyst level you will not usually choose the philosophy. You will work inside one, and the skill is noticing where it leaves gaps. Here is how that shows up in a week.

At refinement, weekly. When the team discusses a story, ask where its risk is and what level would catch it. “This touches the quote service and the app; do we have a test that crosses that boundary?” is a question an analyst can ask on their first day. Requirements written as testable conditions, as in writing the PRD, make this easier.

In code review, daily. Read the tests in pull requests as well as the code. Look for tests with no assertions, tests that mock the thing they claim to test, and new branches with no test at any level.

In exploratory sessions, two or three a week. Book them in the calendar as you would a meeting. Each has a charter and a time box and ends with notes. Anything worth keeping becomes an automated check or a bug report; bug reports that get fixed covers the second.

At triage, after every escaped defect. Ask which level should have caught it and why it did not. One escape is an anecdote. Five escapes at the same seam is a gap in the shape, and the evidence you need to argue for changing it.

Quarterly, with the team. Look at the suite as a whole: how long it takes, how often it flakes, where escapes came from. Redraw the shape if the product has changed. This is the meeting where a philosophy becomes a decision rather than a habit, and it is where the A QA engineer’s week chapter picks up.

BY ORG SIZE
STARTUPunder 30 people

There is no QA function and nobody has chosen a philosophy; the shape is whatever the first engineers wrote. Usually that is a handful of unit tests, no integration tests and the founder clicking through before each release. Do not import a pyramid. Find the two or three paths where a defect costs money or trust, put an automated test across each seam they cross, and run a short exploratory session before each release. Write the shape down in a paragraph so the fifth engineer inherits a decision rather than an accident.

SCALE-UP30 to 300

Several teams have drifted into different shapes, and someone is trying to standardise. This is when the pyramid-versus-trophy argument happens, often in a long thread. Your job is to move it from taste to evidence: escape data by level, suite run time, flake rate. Let shapes differ by product, a library team and a front-end team should not test alike, but require every team to write its shape down and to explain each escape against it. Exploratory testing needs a calendar slot here, or it disappears under release pressure.

ENTERPRISE300 and up

The philosophy is written into standards, a test policy, perhaps an audit control that requires a coverage number. The risk is that the standard outlives the reasoning: a coverage mandate set for a monolith now applies to a hundred services where it measures the wrong thing. Risk-based testing is often formal here, with a register a regulator may read. Changing the shape means changing a policy, which means a proposal with data and a sponsor. Pick one product line, measure escapes before and after, and use that as the case.

ARTEFACT Sketch the test shape for three products ~60 MIN
YOU PRODUCETest-shape sketch

Template

# Test shape: <product>
Owner · Date · Reviewed with: <eng lead>

## The product in one line
<What it does, who uses it, how often it ships.>

## Where the logic lives
Functions: <calculations, rules, parsers>
Seams: <APIs, queues, third parties, other teams' services>
Interface: <flows, layout, devices>

## Top risks
| Risk | Likelihood (H/M/L) | Impact (money, users, regulation) | Rated by |
|---|---|---|---|

## Shape
| Level | Proportion of effort | What it covers | Runs when | Time budget |
|---|---|---|---|---|
| Static (types, lint) | | | every commit | |
| Unit | | | every commit | |
| Integration / contract | | | pre-merge | |
| End-to-end | | | pre-release | |
| Exploratory | | <charter topics> | <cadence> | |
| Production (synthetics, canary) | | | continuous | |

## Deliberately not tested
- <area> — <why the risk is accepted>

## Evidence that would change this shape
<Escapes at a level, flake rate, suite time.>
WORKED EXAMPLE

Marram is a fictional remittance app: 45 engineers, 1.2 million users, 18 payout corridors through nine local partners. Its first QA engineer sketched three shapes in her second month, after an escape where the app and the quote service disagreed on minor and major units.

Quote and fee engine. Logic lives in functions: FX rounding, fee tiers, corridor limits. Top risk: paying out the wrong amount, high impact, rated medium likelihood after the escape. Shape: pyramid. About 60% of effort in unit and property-based tests over 10,000 generated amounts per corridor; 30% in contract tests with the app and the ledger; 10% end-to-end. Not tested: rate-provider outages, which are covered by a circuit breaker and a synthetic check.

Mobile app. Logic lives in the interface and its calls to the API. Top risks: duplicate transfer on a slow network (the idempotency lesson’s case), wrong recipient selected, crash on older Android devices. Shape: trophy. Types and lint; component integration tests for the transfer flow; six end-to-end journeys on two real devices before each fortnightly release; a 90-minute exploratory session per release with charters on poor networks and interrupted flows.

Payout partner integrations. Logic lives at the seams, nine partners with nine APIs. Top risk: a partner changes its response format and payouts stall silently. Shape: honeycomb. Contract tests per partner against recorded responses; sandbox tests nightly; synthetic one-unit payouts in production every 15 minutes per corridor. Not tested: partner sandbox parity, which the team accepts it cannot control.

Now you

You have joined Spindle, a fictional B2B SMS gateway with 70 people and 1,800 business customers, as its first QA engineer. Spindle sends about 40 million messages a month through 14 carrier connections. It has three products: a REST API that customers call to send messages, a web dashboard where they manage numbers and read delivery reports, and a nightly billing job that counts message segments and invoices customers. The API team has 91% unit coverage and no tests that call a carrier. The dashboard has no automated tests. The billing job has 30 unit tests written four years ago. Last quarter, three incidents: messages containing emoji were billed as one segment instead of three for six weeks; a carrier changed its delivery-receipt format and reports showed ‘pending’ for two days; a dashboard release broke number search in Safari. The CTO has asked for a one-page test shape per product by the end of the month, and has said the engineering team will not accept a mandate for end-to-end tests on every story. Write the three sketches.

Self-check

DECIDE

You are the QA analyst on a 12-engineer payments team. The tech lead proposes a new standard: 100% unit-test line coverage enforced in CI, and the existing 40 end-to-end tests deleted because they take 25 minutes and fail intermittently about one run in eight. Two of last quarter's four escapes were integration bugs between the API and the ledger. What do you recommend?

READING
  1. POST
    Test Pyramid Martin Fowler, 2012

    The short canonical statement of the pyramid, with its history from Cohn and Crispin. Read it to know exactly what the original claim was before arguing with it.

  2. POST
    The Practical Test Pyramid Ham Vocke, 2018

    The long version with code: what each layer looks like, contract tests, and the ice-cream cone it warns against. The best single article on automation levels.

  3. POST
    The Testing Trophy and Testing Classifications Kent C. Dodds, 2021

    The trophy in its author's words, with the argument that tests resembling real use buy more confidence. Read it beside Fowler and notice how much they agree.

  4. POST
    Testing of Microservices André Schaffer, 2018

    Spotify's honeycomb: why a service team moved most of its effort to integration tests, and its distinction between integration and integrated tests.

  5. PAPER
    Software Engineering Techniques: report on the 1969 NATO conference, Rome J. N. Buxton and B. Randell (eds.), 1970

    The primary source for the most quoted sentence in testing, in context. The surrounding discussion shows it was an argument for proof, not against testing. Read: Section 3.1, Correctness, for Dijkstra's remark in discussion; section 7.4, Dijkstra's 'Structured programming', for the full argument.

  6. POST
    Code Coverage Best Practices Carlos Arguelles, Marko Ivanković and Adam Bender, 2020

    Google's guidance on what coverage is for, its 60/75/90 rough guidelines, and why it avoids mandates. Bring it to any meeting about a coverage target.

  7. POST
    Heuristic Risk-Based Software Testing James Bach, 1999

    The founding practical essay on risk-based testing: how to find risks from inside and outside the product, and how to let them drive effort.

  8. BOOK
    Explore It! Elisabeth Hendrickson, 2013

    The working guide to exploratory testing as a discipline rather than clicking around. Read the first part before your first chartered session. Read: Part I, the foundations, including how to write a charter.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: A QA engineer's week →