What is Software Testing?

Learn the fundamentals of software testing, including what testing really means, the relationship between errors, defects, and failures, and why testing is essential in software development.

Foundation Module 1 Lesson 1
8 min read

What you'll learn

  • Define software testing and explain its purpose
  • Explain the relationship between errors, defects, and failures
  • List at least 3 reasons why software testing matters

What is Software Testing?

A Simple Definition

Software testing evaluates software to find the gap between expected behavior and actual behavior.

Testing is not just bug hunting. It’s about building confidence that software works, meets requirements, and is ready for real users.

The Chain: Error → Defect → Failure

Three words that sound similar but mean very different things. They form a chain:

Error

Human mistake

Defect

Flaw in code

Failure

Broken behavior

  1. 1

    1. Error (human mistake)

    A developer misreads a requirement. The spec says 'users must be 18 or older' but they interpret it as 'over 18'.

    // Requirement: age >= 18
    // Dev thinks: age > 18
  2. 2

    2. Defect (flaw in the code)

    The error becomes real code sitting in the codebase. It exists whether or not anyone triggers it.

    if (age > 18) {
      allowSignup();
    }
  3. 3

    3. Failure (wrong behavior at runtime)

    An 18-year-old user tries to sign up and is rejected. This is what users actually experience.

    // User, age 18:
    // 'You must be at least 18'

Why Do We Test?

Quick check

Question 1 of 10 correct

A PM asks 'ship now or delay?' — which purpose of testing matters most here?

What Testing is NOT

A Practical Example: The Login Page

Every feature has two sides — the happy path where everything works, and the sad path where things go wrong. Testing covers both.

Happy Path

Everything goes right

Enter valid email
Enter correct password
Login succeeds!

Sad Path

Things go wrong

Enter invalid email
Leave password empty
Error messages shown

Even a simple login page generates dozens of test cases:

What to test
Valid email and password → successful login
Wrong password → error message shown
Empty email field → validation message
SQL injection in email field → handled safely

Check Your Understanding

Question 1 of 30 correct

A developer writes `age > 18` instead of `age >= 18`. An 18-year-old user is rejected. What is the DEFECT in this scenario?