Preview and Definition
In this blog I will describe the techniques of domain testing. These techniques are popular with a lot of testers because of the way they have absorbed a little bit of the best of several other simple-but-effective techniques.
Domain testing, if you’re not familiar with it, is a software testing technique where the minimum numbers of inputs are used to assess the appropriate output of the system, and to ensure that the system does not accept invalid input values.
The dilemma faced sooner or later by absolutely all testers is how to make minimal testing also be optimal testing. Domain testing achieves this by combining two techniques—equivalence testing + boundary values testing—which I will describe for you in detail.
Equivalence and Boundary Testing
Equivalence Testing – the division of potential values into different general “classes”, whose representatives, when tested, will have to show the same expected result (the expected result for a particular class can be either positive or negative)
Boundary Testing – testing values that are at the boundary/junction of certain classes that were previously defined in equivalence testing. It is based on the assumption (fair and reasonable) that most potential errors in the operation of programs will occur at the junction of different classes.
In order to get acquainted with the technique of equivalent and boundary testing using specific examples, we only need to understand the terminology of positive and negative tests.
Positive Tests – system should accept input inside this tests and return no errors, much recommended to combine them.
Negative Tests – system should throw an error, couldn’t combine since you wouldn’t know which input value exactly lead to the error.
Test Example
Let’s look at a specific example that will help us quickly understand how equivalence and boundary testing techniques work in practice. Imagine that we have a random website, on one of the pages of which users have to upload checks/receipts for payment. Therefore, the download of this image will have certain conditions, which we will now use as the basis for our testing techniques.
Requirements
Size – from 100 kb to 900 kb
Name – from 3 to 10 symbols, no digits, no spaces, all languages, all register, all spec symbols
Format – jpeg, png, gif
Equivalence Testing Technique Usage
Now, using the equivalent testing technique, we will work with the requirements for the size and name of the uploaded file. The image below conveniently and clearly shows how we will divide the values into different classes. Accordingly, both in the case of the size and in the case of the file name, the representatives of the second class should give us a positive result, and the representatives of the first and third classes—a negative one.
Boundary Values Testing Technique Usage
Now, by analogy with the previous testing technique, we will again consider the division of potential values into classes, only using the boundary value analysis technique.
Positive and Negative Tests
Now, recall that a little earlier at the beginning of the article we decided on what positive and negative tests are. This knowledge, coupled with the analysis of all potential equivalent and boundary values, allows us to determine the potential values for positive and negative tests/checks.
Now that we have both our positive and negative tests, we can optimize the possible testing by combining positive tests. This is possible, since all positive tests individually should give us a positive response from the system, respectively. Therefore, when several positive values are combined in one test, the result should not change.
Remember that we can’t combine negative tests, since each of them is unique and should cause an error in response from the system, and if we combine them, we simply won’t know which of the negative tests worked or didn’t work. So, we combine positive tests, but do not combine negative ones.
Next we add positive checks for the image format to our positive tests as shown below.
And our negatives test are all separate, and looks like this when we add the negative image format checks.
Conclusion and Food for Thought
Now, having understood looked at specific example of using the technique of equivalence testing and testing of boundary values, we are ready for the main conclusion:
Domain testing equivalence + boundary testing, combining positive tests and not combining negative tests.
These techniques used together are useful for novice testers because they give specific instructions, diagrams, and formalized guidance. More experienced testers may combine various checks in their heads and the main thing that they draw from various test design techniques is a way of thinking.
The “father of testers”, Сem Kaner, said: “Learning a new technique means learning a way of thinking how to test well, not how to follow a procedure”.
Equivalence classes allow us to reduce the number of primitive tests with the same result and save time on more complex ones.
Boundary values give us an intuitive understanding that potential bugs and difficulties will always be at the junction of various functionalities within one application or feature (where one functionality smoothly transitions into another or interacts with it).
The main skill that develops after becoming familiar with many different test design techniques—as you gain experience in what most often works and what does not—is the assessment of potentially critical vulnerabilities in the application.