What is the difference between verification and validation?
60-second answer
Verification asks "are we building the product right?" It checks that work products meet their specifications, usually without running the code, through reviews, walkthroughs and inspections. Validation asks "are we building the right product?" It checks that the software actually meets the user's needs, usually by executing it through functional, system and acceptance testing. Verification is static and happens throughout development. Validation is dynamic and happens on working software.
Explanation
| Verification | Validation | |
|---|---|---|
| Question | Built right? | Right thing built? |
| Type | Static (no execution) | Dynamic (execution) |
| Activities | Requirement reviews, design reviews, code reviews, walkthroughs | Functional, system, UAT testing |
| Done by | QA, developers, BA | QA, end users |
The two together make up the V-model idea: each development phase has a matching test phase.
In interviews, give one example of each. That shows you understand, rather than reciting.
Example
Verification: reviewing the requirement "Password must be 8–16 characters" and noticing it doesn't say whether spaces are allowed.
Validation: running the sign-up screen and typing a 17-character password to confirm the app rejects it with the right message.
Sample code
Verification (review) Validation (execute)
[ ] Requirement is testable [ ] Enter 7 chars -> error shown
[ ] Acceptance criteria are clear [ ] Enter 8 chars -> accepted
[ ] Edge cases are mentioned [ ] Enter 16 chars -> accepted
[ ] Error messages are specified [ ] Enter 17 chars -> error shown