Verification vs Validation, Explained With Examples
What is verification, and what is validation? The general meaning of both words has something to do with confirming that a thing is true or accurate. However, for the scope of this article, we'll be learning about the differences and similarities between verification and validation in the software development process.
What is Verification?
Verification consists of various activities that answer the question "Was it built right?" or, "is the product being built the right way?" In other words, were the customer's specifications understood and correctly implemented? Verification involves the review of documents, design, and code to verify that all the project requirements are met.
Another way to define verification is as the process of checking that the result of a development phase meets the requirements set at the start of that phase. Verification can happen at different stages throughout the product development lifecycle. The result from one phase of verification may form part of the input for another phase.
What is Validation?
Validation answers the question "Was the right thing built?" or, "is the product being built the right product?" That's to say, does the final product function as expected or not? Hence, a validation check executes the actual code or program. Usually, a test team carries out different levels of validation testing. For example, validation can occur as unit testing, integrated testing, or even testing the entire system.
The main objective of all validation activities is to ensure that the end product meets the requirements of all stakeholders. That's to say, validation checks to confirm that the product is able to perform the job it is required to do.
When to Do Verification and Validation
You can carry out verification at an early stage of a project. Since the verification process includes a review of documents, design, and code, you can start the process even before any implementation and continue during the rest of the development phase.
Validation, on the other hand, requires a functional product, and as a result, validation is done at a later stage of the project. You need to have a product or code that you can execute in order to validate it.
Advantages of Verification and Validation
Both verification and validation improve the overall quality of a software product. The following are some advantages of each:
- makes it possible to detect errors and defects early, and
- saves time and cost of development by reducing the chances of implementing specifications incorrectly.
- provides a means for testing and confirming that the behavior of a product meets expectations, and
- detects errors that verification can’t.
What is the difference between Verification and Validation?
The following points show the differences between verification and validation:
- With verification, quality assurance (QA) personnel are responsible for the processes, whereas, with validation, software testers run the tests.
- It is possible to perform verification without the finished product. Validation, on the other hand, requires a product or code to execute.
- Verification comes before validation, hence it finds bugs early while validation finds bugs that verification can’t detect.
- Verification processes include reviews, walkthroughs, and inspection, while validation uses software testing methods, like white box testing, black-box testing, and non-functional testing.
How Verification and Validation Are Related
The main objective of verification and validation is to improve the overall quality of a software product. Both check that the product meets specific requirements and standards. They also complement each other. For example, performing verification prevents errors in the requirement from making it to the implementation (coding) phase. And validation can further validate that the final product functions correctly.
In short, both verification and validation are quality control processes.
Examples of Verification and Validation (How to Do Each)
We may liken verification and validation to the following analogy about baking a cake; where verification would happen when checking the ingredients and method. And validation would be tasting the cake before serving it to guests and finding out if it’s way too salty.
To further explain verification and validation, let's take a look at an example each.
1. Verification of Database Requirements
For this example, imagine we need to build an application with the following requirements:
- We need a signup form that users can enter their details in to subscribe to the client's newsletter.
- The application should be able to save user input to an SQL database.
- The client requires that the application collects a user's email, full name, and city.
We can perform verification testing on the document to make sure that we capture the right data. After that, the results from this finding can become input for the phase of designing the database. In designing the database, we can check that we are assigning the correct data type to fields in our database table as per the requirement specification. In addition, we can also verify that the column length is sufficient for potential user inputs.
2. Validation of Submit Button
Considering the same application from Example 1, we can perform a validation test on the submit button. The application should perform an action whenever a user clicks on the button. These actions include either saving the user’s data to the database or displaying the correct error when the user inputs invalid data.
We can perform this type of validation in several ways. One approach is to write automated tests that assert for whether the data is saved after clicking the button. This type of test will pass only when the assertion is true. Another approach is to test by submitting invalid data. In this case, the assertion expects the correct error message.
Performing automatic tests may require writing test scripts. Also, in order to cover more potential issues, you should test extensively with as many test cases as possible. However, if you wish to perform automatic tests without scripting, you can. Waldo is a no-code testing tool for testing mobile apps. You can try Waldo for free here.
The following are some best practices for verification and validation:
1. Plan Tests
You should have a clear testing plan. For example, verification should start before you start writing code or implementing your software.
2. Test Coverage
You should perform verification at multiple phases of the development process. This increases the depth of testing and your understanding of the product specifications.
In validation, good coverage means writing tests that validate each part of the product extensively. You should test at different levels, including unit testing, integration testing, and system testing. Doing so reduces the chance of missing bugs and defects.
3. Track Design and Requirement Changes
If there are any changes in the product design or requirements, make sure to take them into consideration when you verify and validate. For example, when any changes are made to inputs or expected outputs for a feature or function, you should note such changes and make the necessary adjustments to your tests.
To summarize, both verification and validation play an important part in the overall quality of a product. Verification starts even before you start coding and continues throughout the development phase.
Validation requires that you execute code. As a result, validation comes at a later phase of development. Validation may include unit testing, integration testing, or full system testing. Automatic testing of apps is one way to implement validation testing.
Check out Waldo to learn more about codeless automation testing.