Why We Learn More from Broken Tests than from Perfect Ones

(and what my new book, How to Fail Your Test Automation (Easily!), is really about)

By Masoud Bahrami


People love to find answers to questions they don’t know yet, or to have someone find them on their behalf.
But sometimes, the real learning doesn’t come from finding answers. It comes from failing, from seeing something that should have worked… not work.

When I started collecting stories and lessons from more than a decade of testing and architectural work, I noticed a strange imbalance in our software literature.

There are countless brilliant books, articles, and videos about how to do testing right, about frameworks, strategies, automation, CI/CD, coverage, and craftsmanship.
But very few talk about how and why testing efforts actually fail.

And yet, failure is where most of our real understanding begins.
We don’t evolve as engineers because we automate more; we evolve because we start asking why the automation didn’t help.


Failure teaches what success hides

When teams talk about test automation failure, the discussion almost always begins at the code level:

The developer didn’t write clean tests.
The framework wasn’t chosen correctly.
The QA team lacked skill.

That’s not wrong, but it’s incomplete. It’s like examining a car’s performance only by looking at the tires, because tires make it move.
Or only checking the engine, assuming that’s where power comes from. But a car is a system of relationships, engine, transmission, steering, fuel, electronics, and a small delay, friction, or misalignment in any of them can compromise the whole.

Testing failures are systemic in the same way. A broken test isn’t just a coding problem, it’s a reflection of how a team thinks, designs, and communicates. That’s why I wrote How to Fail Your Test Automation (Easily!), a collection of 60+ lessons I’ve learned (and unlearned) from failed test automation projects.
These lessons didn’t come from theory. They happened to me, and around me. They’re scars from real systems, real teams, real mistakes.


The seven layers of failure (and understanding)

While collecting these lessons, I realized something interesting:
they naturally fell into seven distinct but connected categories. Each category exposes a different way test automation can fail, and, more importantly, how those failures relate to one another. If one weakens, others collapse with it. If one strengthens, the system becomes more resilient.

Here’s a quick overview:

  1. Strategy & Mindset
    Most test automation failures begin before any code is written.
    When teams automate without clear purpose, without asking why a test exists, they end up measuring motion, not progress.
    A test without epistemic grounding is like proof without a hypothesis.
  2. Test Design & Intent
    Tests often fail because they assert behavior without reflecting understanding.
    This layer explores how to design tests that model intent, not just mechanics, tests that say something meaningful about your domain.
  3. Technical & Execution Mistakes
    From brittle selectors to flaky environments, this is the visible surface of failure.
    But underneath, it’s a story about fragility, feedback loops, and misplaced complexity.
  4. Tools & Infrastructure
    A tool doesn’t fix what’s unclear.
    Automation frameworks, pipelines, CI/CD, they can amplify both clarity and confusion.
    The goal is not to add more tools, but to make them conversational partners in understanding the system.
  5. Team & Collaboration
    Testing is a social act.
    A failed test often mirrors a failed conversation.
    Misaligned language, fragmented responsibilities, and unclear ownership can silently destroy testing culture faster than bad code ever could.
  6. Cost & Value
    Every test has a cost, in time, maintenance, and cognitive load.
    But not every test delivers equal value.
    Understanding when not to test is just as critical as knowing what to test.
  7. Learning & Reflection
    Finally, there’s the meta-layer, how teams learn from their testing experience.
    Retrospectives, pattern recognition, epistemic awareness, these turn failure into fuel for growth.

These seven categories are not hierarchical.
They are independent, but deeply intertwined, much like subsystems in a complex machine.

You can strengthen one, but if another remains weak, the whole system will still wobble.
And just like in software architecture, the health of the whole depends on the coherence of the parts.


A system that can’t be tested is a system that can’t be understood

It’s easy to say our system isn’t testable or tests are flaky.
But beneath that sentence lies a deeper truth:
a system that can’t be tested is a system whose design and modeling are unclear.

Testing, at its core, is not about correctness, it’s about comprehension.
It reveals whether we’ve truly understood what the system is supposed to do, and what we believe about it.

That’s why testing failures are so valuable: they expose epistemic debt, the gap between what we think we know and what’s actually true in the code.


The book

The book is short, honest, and practical.
Each section contains concrete lessons, reflections, and heuristics, not as rules, but as thinking prompts.
It’s not another book about frameworks or metrics. It’s a book about understanding.

If you’ve ever struggled with test automation that keeps breaking,
if you’ve ever wondered why your coverage is high but your confidence is low,

or if you simply want to think more clearly about how tests shape understanding, this book is for you.

It’s available now, free to download on Leanpub:
https://leanpub.com/testautomationmistakes


Why this matters

We learn more from our broken tests than from our perfect ones. Success teaches repetition; failure teaches reflection. Every failed test is an invitation to look deeper, not just at the code, but at ourselves as designers, collaborators, and learners.

The real craft of testing begins when we stop chasing green checks
and start asking:

What does this test say about our understanding of the system?

Because in the end, a test that fails with meaning is far more valuable than a test that passes without it.

Leave a Reply

Your email address will not be published. Required fields are marked *