In this article we will look through the notion of validation and get to know how to test validation.
First thing first, let’s make it clear with the notion of validation in the IT sphere.
To cut a long story short,validation is the process of checking the data in accordance with the early approved standards, requirements or rules. For instance: the birthday date field accepts only full positive numbers (including zero) and cannot be more than 31 (as this is the maximum amount of days in a month). Another common mistake is that people often confuse validation and verification.
Verification is the confirmation that everything was performed according to the standards, requirements and rules.
So, as we defined the notion of the validation, stands the question — is it really needed? The answer is simple — it provides the gathering of the needed and sorted information. Validation also can serve as a security means, because if unknown data is given to the database, it can freeze and restart, show private information or delete everything.
There are three types of validation:
Instant validation is applied in case when the information is checked according to the requirements while the user is typing it.
After losing focus validation happens when the user switches to the next field or clicks on another area.
After sending a request validation starts only after clicking the «Send» and only after this the system will start verification of the fields.
And, of course, there comes a question, which of these is the best one? Indeed the one that allows users to see the information faster, decreasing the time to return and correct the mistake made — and it is an instant validation. However, it is not always possible to provide such a type of validation, so the second most popular is the validation after losing focus. The third type, after sending a request validation, is carried out only in case if the validation after losing focus is not possible.
Also, it is important to mention one important case, when the separate field go through the validation and don’t show mistakes, however, with the combination of those, they will show the results that won’t be acceptable for the system. Let us look at the example of the mobile phone field: you type in the country code (+380) — the validation is successful because such code exists. Next, input the phone number (9611001231) – validation is also successful, but after all the system won’t accept the digits because the phone number of this country can’t exceed 9 digits.
In cases when the validation is not passed, the user receives the visual notification in form:
text message (mostly red);
red framed field;
red framed text;
combination of the messages (red color message and red text are displayed at the same time);
special symbols or signs (exclamation mark, etc).
These are the most common notifications.
So how not to allow the user to send the data that hasn’t been validated? Everything is simple — block or hide the send button or simply not send the data until everything is inputted according to the requirements.
Let us analyze closely, how to properly approach the validation testing. These examples are not the solution for all types of validation, they depict the most common ones.
Let us look at the registration form first.
First of all, we need to use the testing documentation to know where and what type of documentation is used. If the testing documentation is absent, we must rely on our experience and logical thinking.
Fill all the fields with the correct (valid) data and make sure that the system accepts the valid data first.
Fill all fields with random invalid data, in order to see what fields have failed the check and which ones are to test more in detail.
Check the presence of error notifications. Check whether each field shows the notification about invalid data or input.
Check each field separately. For example, let us do the following checks:
- input only symbols;
- input only numbers;
- input only Cyrillic letters;
- input only Latin letters;
- register with the inputs above.
The expected result must be the following:
Input the correct (valid) data and then substitute it with invalid.
Leave the field empty (no data).
Check the boundary meanings (enter the boundary meanings in the password field):
Check the connection between fields (as it is with example of password confirmation field):
And in the end, it is worth saying that validation testing is a very important point in any interface and you need to understand that sometimes the security of a particular client's data, as well as the security of all data, depends on the correctness of data entry. A specialist in the field of QA needs not only to check validation, but also to understand very clearly at what points the system has a vulnerability (flaw) and what needs to be improved.