Verification vs. Validation

𑇐 Software Tester Interview Preparation

Tatiana Timonina

August 25th, 2024 𑇐 10 min read

In this post:

# What is verification?
# Example of verification testing
# What is validation? 
# Example of validation testing 

Introduction

This article is part of the Top Manual Testing Interview Questions series. It’s suitable for beginners as well as those with experience. The article delves into the basic distinctions between validation and verification and uses real examples to clarify these concepts. After reading this article, you will be able to discuss these processes confidently during interviews. Rather than just providing short answers, this article aims to build a solid understanding of these processes, which will be beneficial as you embark on your new career. Let’s enhance your knowledge of fundamental testing topics. Topics covered: – The differences between validation and verification. 

What is verification?

Verification is a process that answers the question: “Are we building our system in the right way?”. Verification doesn’t involve executing the code and is known as static testing; it relies on checking documentation and design specifications to ensure that the procedures are correct for achieving the intended results. Verification activities pursue the main goal of static testing, which is catching defects as early as possible during the development process. 

Verification techniques include: 

– Checklists 

– Walkthroughs

– Peer review 

– Static analysis tools 

Here is an example of when to use verification testing

Let’s consider the software development process of an online library. Before the implementation phase, team members carefully read and review documentation, such as code and requirements, to ensure there are no mistakes. Verification activities must be conducted at every stage of the software development before new functionality is implemented. The team is currently working on a new feature that will allow users to check the availability of books in libraries.

Consider a button labeled  “Check availability”. Before implementing a new functionality, verification tests would review all relevant requirements to make sure they are clear. This should include:

Let’s say the documentation says the button “Check availability” must be placed intuitively within the UI just under every book on the page. Verify that the button’s labeling and styling meet the design guidelines. Let’s say it should be yellow with black lettering and it also has requirements for the size. 

Ensure that the flow from searching for a book to checking its availability is logical and user-friendly. And the system design includes proper error messages and handling in case the availability check fails.

Before writing any code, the software development team should plan how the code reviews will be conducted once the implementation starts. At this stage, the team should identify who will be responsible for reviewing the code related to implementing the new functionality “Check availability”.

Example of algorithm verification:

– Ensure that the algorithm for checking availability meets the performance requirements (e.g., response time).

Requirement: 

– The system should return the availability status of a book within 2 seconds under normal load conditions.

Peak Load: 

– During peak usage (e.g., 1000 concurrent users), the response time should not exceed 5 seconds.

Drafting the test cases that will be used to verify the functionality of the “Check availability” button. These should cover:

Data Privacy: Verify that the system design ensures user privacy, especially regarding any personal data that might be involved in the book availability checks.

Compliance: Ensure that the functionality complies with any relevant regulations (e.g., GDPR, CCPA) if user data is involved.

Review with Stakeholders: Before implementation, conduct reviews with stakeholders (product owners, project managers, etc.) to ensure that the planned functionality meets the business needs and expectations.

Sign-Offs: Ensure that there is documented approval for the design, requirements, and planned implementation approach.

By carrying out comprehensive verification activities such as these, you can help ensure that the implementation phase of the “Check availability” button proceeds smoothly, with minimal risk of errors or rework.

What is validation?

When developing a system, evaluating whether it meets its specified requirements is important. This evaluation process is called validation. Validation also called Dynamic testing involves executing the code to find the defects in the product and ensure the desired results. It focuses on determining whether we are building the right system. Visibly, the validation process starts after the verification process ends, but they go hand in hand.

Software validation techniques: 

– Unit testing

– Integration testing 

– System testing 

– Acceptance testing

– Regression testing

Validation techniques include:

 – Test cases

 – Prototypes 

– Dynamic analysis tools 

– Actual system execution 

Here is an example of when to use validation testing

We need to break down the scenario into different testable components to write unit tests, integration tests, system tests, and acceptance tests for the new functionality. Here’s a structured approach to create these tests for the online library system where the team is implementing functionality to check the availability of books in libraries.

1. Unit Testing

Unit tests are focused on testing individual components or functions in isolation.

In this example, we are not going to dive deep into writing unit tests for each component of the system, we just want to introduce the general components and bring ligt to one of them. 

Testable Components:

– BookAvailabilityService: A service that checks if a book is available (identifying when a book is available / when the book is not available / when the book ID does not exist).

– LibraryDatabase: A mock or actual interface to the database that stores the book inventory (test if the database query returns the correct availability status for a book, test for handling database connection failures).

– UserInputValidation: Validates user input when searching for a book (test for valid book ID formats, test for handling empty or null inputs, test for handling invalid characters in input).

2. Integration Testing

Integration tests focus on testing how different modules or services work together.

Integration Points and Examples:

– BookAvailabilityService and LibraryDatabase: Ensure that the service correctly interacts with the database. Simulate a database with known entries and ensure the service returns the correct availability status.

– User Interface and Backend Services: Test the flow from the user input to the service call and back to the user. Input a book ID through the UI, validate the input, query the database through `BookAvailabilityService`, and display the correct availability status.

3. System Testing

System tests involve testing the entire system as a whole, typically in an environment that closely resembles production.

System Test Scenarios:

– Check Book Availability: Test the full system from with real data to see if a book’s availability status is displayed correctly.  

– Error Handling: Test the user interface’s response when there is an invalid input or if the book ID does not exist.

– Security Tests: Test that unauthorized users cannot check book availability.

4. Acceptance Testing

Acceptance tests are based on the requirements and are typically done from the user’s perspective to ensure the system meets the business needs.

Example Acceptance Tests:

– Test User Check Availability Feature: Execute a scenario where the user inputs a valid book ID and check that the system returns the correct availability status.  

– Test System Behavior for Invalid Input: Input an invalid book ID and verify that the system returns an error message.

– Test System’s Resilience: Simulate a scenario where the database is temporarily unavailable and ensure the user receives a meaningful error message.

Summary

In the table below, we highlight the bullet points for software validation and verification for better comprehension.

VerificationValidation
Definition
The process of evaluating documentation and design specifications through the software development process. 
The process of evaluating the software application during or at the end of the development process.
Concepts– Static process (no executing the code);

– Focuses on developing process
– Dynamic process (involves executing the code);
– Focuses on the result
Slogan
“Are we building our system in the right way?”

“Are we building the right system?”
Techniques– Checklists 
– Walkthroughs
– Peer review 
– Static analysis tools 
– Unit testing
– Integration testing 
– System testing 
– Acceptance testing
– Regression testing

 – Test cases
 – Prototypes 
– Dynamic analysis tools 
– Actual system execution

Thank you for reading this article. I hope that the concepts you have learned will be valuable tools in your future endeavors in software testing and help to secure your job as a software tester. As you proceed in your career development, remember to keep asking questions, stay curious, and, most importantly, enjoy the process.