The Testing Trophy by Kent C. Dodds: A Deep Dive
In 2018, Kent C. Dodds published a post titled "Write tests. Not too many. Mostly integration." The phrase became a testing maxim, and the accompanying visual—the Testing Trophy—became an alternative to the traditional Test Pyramid.
The Trophy doesn't just rename the Pyramid's layers. It makes a substantive argument about where testing effort should be concentrated, and why.
The Shape
The Testing Trophy looks like this:
┌──────────┐
│ E2E │ (small)
┌─┴──────────┴─┐
│ Integration │ (wide — most tests here)
┌─┴──────────────┴─┐
│ Unit │ (smaller than you think)
┌─┴──────────────────┴─┐
│ Static Analysis │ (base — free value)
└───────────────────────┘The widest section—integration tests—sits above unit tests. This is the Trophy's key claim: integration tests give you the best return on your testing investment.
The Four Layers
Static Analysis (base)
TypeScript, ESLint, flow types, Prettier. These aren't "tests" in the traditional sense, but they catch entire categories of errors for free—before code runs.
// TypeScript catches this immediately, no test needed
function getUser(id: string): User {
return { name: "Alice" }; // Error: missing required fields
}Static analysis is the cheapest layer. If you're not using TypeScript (or similar) in 2025, you're writing tests for problems your compiler could catch.
Investment: Low. Set it up once, it runs forever.
Return: High. Eliminates entire classes of bugs.
Unit Tests (below integration)
Unit tests test a single function or class in isolation. The Trophy doesn't eliminate them—it puts them in perspective.
// Good unit test: pure function, no dependencies
it("calculates compound interest correctly", () => {
expect(compoundInterest(1000, 0.05, 12, 10)).toBeCloseTo(1647.01);
});Unit tests shine for:
- Pure functions with complex logic
- Edge cases and boundary conditions
- Error handling
- Mathematical calculations
They're less valuable for functions that primarily coordinate other functions (orchestrators), because mocking their dependencies means you're testing the fake, not the integration.
Investment: Moderate.
Return: High for logic, low for orchestration.
Integration Tests (the wide middle)
This is the Trophy's center of gravity. Integration tests verify that multiple units work together—without mocking everything away.
Kent's definition is deliberately broad: integration tests test "how several units work together." This could mean:
- A React component interacting with state management
- A service calling a database with a real connection
- An API route handler processing a real request
- Multiple functions working together to process a workflow
// Integration test: tests the React component with real hooks, real routing
import { render, screen, userEvent } from "@testing-library/react";
it("submits form and shows success message", async () => {
render(<RegisterForm />);
await userEvent.type(screen.getByLabelText("Email"), "alice@example.com");
await userEvent.type(screen.getByLabelText("Password"), "securepass123");
await userEvent.click(screen.getByRole("button", { name: "Register" }));
expect(await screen.findByText("Registration successful!")).toBeInTheDocument();
});This test doesn't mock the form library, the validation logic, or the component state. It renders the real component and interacts with it as a user would.
Why integration tests give better ROI:
Unit tests with heavy mocking create a gap: your mocks might not behave like the real dependencies. Integration tests close that gap by testing real interactions.
// Unit test: tests function in isolation with mocked repo
const mockRepo = { save: jest.fn().mockResolvedValue({ id: 1 }) };
const user = await createUser("Alice", mockRepo);
expect(mockRepo.save).toHaveBeenCalled();
// ✓ But does the real repo actually save correctly?
// Integration test: tests function with real (or realistic) repo
const repo = new InMemoryUserRepository(); // realistic, not mocked
const user = await createUser("Alice", repo);
expect(await repo.findById(user.id)).toBeTruthy();
// ✓ Tests the actual interactionInvestment: Higher setup cost per test.
Return: Highest—tests realistic behavior, fewer false positives.
End-to-End Tests (top)
E2E tests drive a real browser against a real application. They're the most confidence-giving but also the slowest and most expensive to maintain.
// Playwright E2E test
test("user can sign up and receive welcome email", async ({ page }) => {
await page.goto("/register");
await page.fill("[name=email]", "alice@example.com");
await page.fill("[name=password]", "SecurePass123");
await page.click("[type=submit]");
await expect(page.locator("text=Welcome, Alice!")).toBeVisible();
});The Trophy doesn't eliminate E2E tests—it keeps them focused on the most critical user flows. A small number of well-chosen E2E tests covering happy paths and critical workflows gives you confidence without the maintenance burden of hundreds of brittle browser tests.
Investment: Highest.
Return: Highest confidence, but expensive to maintain.
The Core Argument: Test Confidence vs Cost
Kent Dodds frames the Trophy in terms of the confidence each test type provides relative to its cost:
High Confidence
│
E2E │ ████████████████
│
Integration │ ████████████
│
Unit │ ████████
│
Static │ █████████████ (free!)
│
Low └──────────────────────
Low Cost → High CostIntegration tests have a favorable confidence-to-cost ratio. They test real behavior (higher confidence than unit tests with mocks) without the full cost of E2E tests.
The "Mostly Integration" Prescription
Kent's recommendation: concentrate your testing investment where the confidence-to-cost ratio is best. For most applications, that's integration tests.
This doesn't mean:
- ❌ Never write unit tests
- ❌ Skip E2E tests entirely
- ❌ Replace all your existing tests
It means:
- ✓ When you're deciding where to spend testing effort, default to integration tests
- ✓ Write unit tests for complex pure logic
- ✓ Write E2E tests for critical user journeys
- ✓ Use TypeScript (or similar) to eliminate entire categories of bugs for free
Kent's Influence on React Testing Library
The Testing Trophy and React Testing Library (RTL) reinforce each other. RTL's API guides you toward integration tests by making it hard to test implementation details:
// RTL discourages this (testing implementation)
const component = render(<Button />);
expect(component.instance().state.clicked).toBe(true);
// RTL encourages this (testing behavior)
const { getByRole } = render(<Button onClick={handleClick} />);
await userEvent.click(getByRole("button"));
expect(handleClick).toHaveBeenCalled();The motto: "The more your tests resemble the way your software is used, the more confidence they can give you."
Criticisms and Counterpoints
"Integration tests are too slow"
Integration tests are slower than unit tests but faster than E2E tests. With good tooling (in-memory databases, realistic test fixtures, parallel execution), an integration test suite for a medium-size app can run in under a minute.
"Unit tests are more predictable"
Unit tests with mocks are predictable—but they're predictable about a fake world. Integration tests are less isolated but more realistic.
"We need 80% code coverage"
Coverage from integration tests counts as much as coverage from unit tests. The Trophy doesn't say "write fewer tests"—it says write tests that give the most confidence.
Applying the Trophy
For a new feature:
- Static: TypeScript types, ESLint rules—free, set up once
- Integration first: Write integration tests that describe the feature's behavior from the outside
- Unit tests for complex logic: If there's a tricky algorithm or calculation, add unit tests targeting it specifically
- E2E for critical paths: Add an E2E test if this feature is on a user flow that must never break
HelpMeTest and the Trophy
HelpMeTest lives at the integration/E2E boundary of the Trophy. Plain-English test scenarios run against your real application in a real browser—capturing the behavior that integration and unit tests can't reach.
When your integration tests (unit + integration layer) pass but real users still see bugs, HelpMeTest's E2E layer catches it. You write the tests in plain English; HelpMeTest runs them 24/7.
Summary
The Testing Trophy:
- Static analysis at the base: free, high-value, often skipped
- Unit tests: focused on complex logic; not everything needs a unit test
- Integration tests: the widest, most valuable layer—test real behavior
- E2E tests: small, focused on critical user flows
The core insight: write tests that resemble how your software is actually used. Integration tests do this better than unit tests with heavy mocking, at a fraction of the cost of full E2E tests.