Course contentsShow
← Computer Science
Lesson 2215 of 2,87250. Software TestingFree lesson

Verification vs Validation

Distinguishing between building the product right (verification) and building the right product (validation).

Verification vs Validation

What you'll learn: You'll understand the crucial difference between checking if you built the software correctly versus checking if you built the correct software.

The Core Distinction

In software testing, verification and validation sound similar but address fundamentally different questions:

  • Verification asks: "Are we building the product right?"
  • Validation asks: "Are we building the right product?"

Think of verification as checking your work against the blueprint—did you follow the specifications correctly? Validation, on the other hand, checks whether the blueprint itself matches what the customer actually needs.

Verification: Building It Right

Verification ensures the software meets its documented specifications and requirements. It's an internal consistency check. You're comparing what you built against what you said you would build.

Example: If the specification states "the login function must accept usernames between 6-20 characters," verification tests whether your implementation actually enforces those exact limits.

Verification is often done through code reviews, static analysis, and testing against documented requirements.

Validation: Building the Right Thing

Validation ensures the software actually solves the user's problem and meets their real-world needs. Even if your software perfectly matches the specifications, it might still be the wrong solution.

Example: Your login system might flawlessly enforce the 6-20 character rule, but if users actually need to log in with email addresses (which can be longer), you've built the wrong thing—even though you built it correctly.

Validation typically involves user acceptance testing, beta testing, and stakeholder feedback.

A Simple Analogy

Imagine ordering a pizza. Verification checks that the pizza has exactly the toppings you ordered. Validation checks that you ordered the right pizza for your dietary needs and preferences in the first place.

Key Takeaway: Verification confirms you followed the plan correctly; validation confirms the plan was correct to begin with. Both are essential for quality software.