If you have worked in QA or software development for more than a week, you have seen the Test Pyramid. It is probably on a whiteboard somewhere in your office right now, slowly fading under fluorescent light.
Mike Cohn introduced the idea years ago, and it is still one of the most useful mental models in testing. The pyramid tells us to write lots of fast unit tests, a decent number of integration tests, and only a few end to end tests, since end to end tests are slow and expensive to maintain. It is simple, it is memorable, and it fits nicely on a slide.
But here is the thing nobody tells you in the training session. The pyramid was built to optimize for engineering speed and cost. It was never really built to answer the question your business actually cares about, which is whether a real user can complete a real task without everything falling apart.
What the Pyramid Gets Right
Let's give the pyramid its due first, because it earned it.
Unit tests are cheap, fast, and give you instant feedback when something breaks. Integration tests check that your components play nicely together. Both are essential, and no serious testing strategy should skip them.
The problem is what happens next. Unit tests reduce technical risk. They do not tell you if a customer can actually register, add something to their cart, and check out. Integration tests help too, but they usually run against mocked dependencies, so they are testing an approximation of reality, not the real thing.
That gap between "our code passes its tests" and "our customer can actually use the product" is exactly where the pyramid quietly stops helping you.

The Business Doesn't Care About Your Pyramid
Picture this. Your unit test coverage is sitting at a beautiful 92 percent. Your team is proud. Then a customer tries to check out, the payment step silently fails, and nobody notices until support tickets start piling up.
Nobody in the leadership meeting is going to ask about your unit test percentage that day. They are going to ask why nobody caught a broken checkout flow before it reached a customer.
This is the moment where the pyramid quietly flips upside down. From the business point of view, end to end tests are often what actually earns trust, because they are the ones checking whether a user can register, shop, or submit a claim from start to finish. Integration tests still matter here too, but on their own they cannot fully answer that question, because they are usually built on mocked dependencies that only approximate the real system.

"E2E" Does Not Mean "Just Click Around in the UI"
Here is a common mistake, and honestly, I have made it myself early in my career. People hear "end to end test" and picture a Selenium script clicking buttons for three minutes while everyone in the retro complains about how slow and flaky it is.
That reputation is deserved, but only when E2E tests are built the lazy way. A well designed E2E test is not just UI automation wearing a fancy name tag. It should combine multiple layers to prove the system works where it counts.
Here is what a smarter version looks like in practice:
- Precondition: Seed a test user and product catalog directly through the API, skip the UI for setup
- UI flow: Log in and complete checkout using Playwright or Selenium, but only for the part that actually needs a browser
- Verification: Confirm the order landed correctly in the database, not just that a "success" message appeared on screen
This is still an end to end test. It still proves the full user journey works. But it is faster, cleaner, and far less likely to fall over because a loading spinner took an extra 200 milliseconds.
Okay, But What About Flaky Tests?
This is usually where someone in the comments says "sure, but E2E tests are flaky and slow, that's the whole reason the pyramid exists in the first place." And that person is right to push back, so let's actually deal with it instead of pretending it is not a real cost.
The data backs up the complaint. Google's own engineering research found that roughly one in seven test runs hits a flaky failure at some point, and flaky tests make up a meaningful chunk of all reported failures in large test suites. Microsoft's research put the average time a developer spends investigating a single flaky failure at around thirty minutes, and that is just the investigation, not the fix. One industry benchmark report also found that team-reported test flakiness more than doubled between 2022 and 2025 as pipelines got more complex.
So no, this article is not telling you to swap your pyramid for a tower of wobbly E2E tests and call it a day. It is saying the fix for flakiness is better engineering, not fewer end to end tests. A few things that actually help:
- Seed and tear down test data through the API instead of the UI, so setup is not where your flakiness lives
- Run your critical path E2E tests on every commit, and push the wider, slower E2E suite to a nightly or pre release run
- Add smart retries for genuinely flaky infrastructure issues, but track retry rates so you notice when "flaky" is actually a real bug hiding in a costume
- Give someone actual ownership of the E2E suite, because a test suite that everyone owns is a test suite nobody maintains
So Which Model Do We Actually Use?
Good news, you do not have to pick a side and defend it forever like it is a sports rivalry.
You will also see other shapes proposed over the years, like the Testing Trophy, which puts more weight on integration tests, or the Testing Honeycomb, which leans toward service level tests for certain systems. They are all reaching for the same goal from a different angle: matching your test investment to where your actual risk lives, instead of copying a shape because it looked good in a conference talk.

A workable approach for most mid sized product teams looks something like this:
- Unit tests: the majority of your suite, they are your speed layer
- Integration tests: a solid middle layer, catching the "these two services disagree about a field name" problems
- Critical path E2E tests: a small, fast, tightly scoped set that runs on every single commit and covers the handful of journeys that would actually hurt the business if they broke, think login, checkout, and submitting a claim
- Full regression E2E: a larger, slower suite that runs nightly or before a release, catching the long tail of edge cases without blocking every developer's day
The exact ratio depends on your product, but the principle does not change. Keep the pyramid for engineering speed. Keep a lean, well built E2E layer for business confidence. Do not force yourself to choose only one.
The Bottom Line
The Test Pyramid still holds up, especially when your goal is speed and scalability on the engineering side. But do not ignore the inverted view from the business side, where end to end tests are often what actually earns trust.
And please, for the sake of everyone's sanity, stop treating E2E as just UI automation. Combine API, database, and UI validation, and you get tests that are fast, reliable, and actually mean something.
Because at the end of the day, quality is not about a green checkmark next to your unit tests. It is about proving your system works in the hands of the people actually using it, even if they never see a single line of your beautiful, well organized test code.
Top comments (0)