Product developmentTesting approaches and practical techniques

More test design techniques

7 minutes read

As we continue our exploration of test design techniques, it's important to emphasize that techniques are not alternatives to each other. Each is useful in certain test cases, and the tester needs to be aware of this.

Pairwise testing

In a situation where we have a lot of parameters with a lot of values, we simply cannot test all of them physically. In this case, we use the pairwise testing technique.

Let's start with an example, so it will be easier to understand. On the site "Flowers 24", there are 3 parameters (dropdown elements). Each of them has several values and we need to test all their combinations.

Pairwise testing task

Let's make such tests:

Number of pairwise tests

To avoid the need to test all 8 combinations, we employ the pairwise testing principle. This approach ensures that each parameter value is paired at least once with every value from another column, resulting in the creation of unique pairs or combinations of two values.

In this particular example, following the application of the pairwise testing technique, we're left with four remaining rows. Specifically, the "violet" option is paired once each with "size 20" and "size 50," as well as with the colors "pink" and "yellow." The same applies to "tulip" and the other parameters in the dataset.

Result of pairwise testing

It has been proven that in 98% of cases, errors appear when testing combinations of two parameters against each other. Therefore, pairwise is a very effective technique for this kind of testing.

Testers often use additional software to optimize their work. For pairwise testing, there is an application that helps to compile pairwise testing scenarios in the form of a convenient table, for example pairwiseTool. You can also search for other tools.

Equivalence classes

An equivalence class is a set of data whose processing leads to the same result. To check the equivalence class, it is enough to take one value inside the class and one or two outside it.

Equivalence classes are of two types: linear and non-linear. Linear class (ordered values) is almost always a range of numbers on a numeric line. This class can have valid values within the range, as well as boundary values. The linear class is inextricably linked to boundary values. A non-linear class (unordered values) is a set of symbols, text data, etc., which have no boundary values.

Tests can be considered equivalent when:

  • The tests check the same part of the system (e.g. the login field).

  • If one test finds an error, then the other is likely to find an error.

  • The tests use similar sets of input data (a set of valid emails).

  • To run the tests, the same operations must be performed.

Let's look at a detailed example of a linear class. There is a program that determines your age state using the following algorithm:

  • 0 to 10 years old is a child.

  • 11 to 18 years old is a teenager.

  • 19 to 25 years old is an adult.

Example of equivalence classes

These three intervals are the equivalence classes. Let's highlight the data set for testing the first equivalence class:

  • Acceptable values for the interval (0-10).

  • Invalid values to the left of the interval (minus infinity to -1).

  • Unacceptable values to the right of the interval (11 to plus infinity).

In this case, we could get the following values for testing:

  • Positive scenario: 5.

  • Negative scenario: -5.

  • Negative scenario: 15.

But, as stated earlier, linear equivalence classes are inextricably linked to boundary values. Based on this fact we get the following:

  1. To test the positive scenario, we use the number 5.

  2. By selecting the boundary values, we get -1, 0, 1, and 9, 10, 11.

  3. Negative tests (invalid values) will automatically be checked by the numbers -1 and 11, which are just the boundary values.

The final tests are (-1, 0, 1), 5, (9, 10, 11). Using equivalence classes and boundary values, we have reduced the number of tests several times.

Now let us consider an example of a nonlinear equivalence class. Let's imagine that we need to test email authorisation on a website. Here we can't distinguish boundary values, because the set of email addresses has no boundary values. But we can distinguish two equivalence classes, with valid and invalid email addresses.

  • Correct (valid) email addresses are those that, when processed, result in proper authorisation on the site.

  • Incorrect (invalid) email addresses result in an error.

We can have an infinite number of both correct and incorrect addresses, and we won't be verifying authorisation for each one of them. So let's take any valid email address and any invalid one:

Thus we have only 2 tests to make sure that the functionality works correctly (or incorrectly).

Exhaustive Testing

Within this technique, all possible combinations of input values should be checked, and theoretically, this should find all problems. In practice, it is not possible to apply this method due to the huge number of input values and lack of time.

Conclusion

In conclusion, our exploration of test design techniques underscores the importance of understanding that these techniques are not mutually exclusive options. Rather, each technique serves a specific purpose and is valuable in particular test scenarios. Testers need to be aware of the appropriate application of these techniques to optimize their testing efforts.

8 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo