Topic 01

Why We Test: Confidence, Not Proof

Concept

Here's a truth that surprises beginners: testing does not prove software is bug-free. Nothing can — there are always more inputs and situations than anyone could ever check. What testing actually does is build confidence that the important things work, and keep working as the code changes. That shift, from "proof" to "confidence", is where quality engineering begins.

A test is just a check that the code behaves as expected for a given situation — usually code that runs your code and confirms the result. Most are automated, so they can run thousands of times for free.

A smoke detector is the right analogy. It doesn't guarantee there will never be a fire, and it can't catch every possible danger — but it reliably catches the dangerous ones early, which is exactly what makes it worth having.

What Testing Buys

The real payoff of tests is the confidence to change code without fear. Software is changed constantly — new features, fixes, refactoring — and every change risks breaking something that used to work. A good set of tests catches those breaks immediately, so you can move fast and stay safe at the same time. Without tests, every change is a gamble; with them, change becomes routine.

You Can't Test Everything

Because the possible inputs and situations are effectively infinite, you can never test them all — so testing finds the presence of bugs, never proves their absence. The skill is choosing the right tests: the important behaviors, the likely mistakes, the things that would hurt most if they broke. More tests isn't automatically better; well-chosen tests are.

Tests as a Safety Net

The best way to picture a test suite is a safety net under everything the team does. It's what lets a developer refactor a tangled function (Chapter 7) or merge a risky change without holding their breath — run the tests, and if they're green, the important behavior is intact. This is the deep link between testing and every other quality practice: tests are what make fast, fearless change possible.

Quality Is Everyone's Job

Finally, testing isn't a phase you bolt on at the very end, and it isn't only QA's job. Developers write tests as they write code; quality is built in throughout, by everyone, not inspected in at the finish. The teams that ship reliable software treat testing as a continuous part of building, not a gate to squeeze through right before release.

On the Cadence team, this is lived rather than preached. Because reminders, streaks, and check-ins all have tests, the team changes the app every week without holding their breath. When a refactor or a new feature accidentally breaks an old behavior, the tests catch it in minutes — long before a user ever would. The suite is their confidence, and it's why they can move quickly without being reckless.

Common Confusions
  • "Testing proves the code is correct." It raises confidence, never proof — you can't check infinite inputs. Tests find bugs that are there; they can't guarantee none remain.
  • "More tests are always better." The right tests matter, not the sheer count. A few well-chosen tests on important behavior beat hundreds that check trivial things.
  • "QA tests the software at the end, so developers needn't." Testing runs throughout and is everyone's job — developers write tests as they code. Quality is built in, not inspected in at the finish.
Why It Matters
  • Reframing testing from "a chore" to "the thing that makes fearless change possible" is the mindset shift behind everything in this chapter.
  • Understanding tests as a safety net explains why they enable refactoring, continuous integration, and fast releases — they all rest on it.
  • Knowing you can't test everything teaches the real skill: choosing the tests that matter, instead of chasing an impossible "test everything".

Knowledge Check

What does testing actually achieve?

  • Confidence that the important things work and keep working through changes
  • Mathematical proof that the software contains absolutely no bugs
  • A guarantee that the finished program will always run as fast as it possibly can
  • An automatic way to write all the features the product needs

Why can't testing prove software is bug-free?

  • The possible inputs are effectively infinite, so you can't check them all
  • Because the testing tools that are available today are simply far too primitive
  • Because teams never have quite enough testers to check it all
  • Because automated tests give random, unreliable results each run

What is the main practical benefit of a good test suite?

  • It's a safety net that lets you change and refactor code without fear
  • It makes the finished program run noticeably faster for all of its users
  • It removes the need for developers to write the application code
  • It automatically deploys the finished software out to all users

Why is "QA tests it at the end, so developers needn't" a confusion?

  • Testing runs throughout and is everyone's job, including developers
  • Because QA does no real testing and developers must do it all alone
  • Because all testing must be finished before any code is written
  • Because quality can only ever be added in one final testing phase

You got correct