4Test Design Techniques
To better illustrate the process of test design, let us take a very common example (see [BIN 00, pp. 5–9] and [MYE 79, pp. 1–3]). A software receives three integers, separated by commas, representing the length of the sides of a triangle. The software must provide the type of triangle or a message if the three values do not represent a triangle.
How many tests should we consider?
It is important to remember that a valid triangle must respond to two conditions: no side may be equal to zero, and each side must be smaller than the sum of the other two sides. This means that a triangle with the sides a, b and c:
Then, s > a and s > b and s > c.
A triangle can be equilateral (three sides of equal length), isosceles (two sides of equal length) or scalene (no two sides are equal).
We could envisage the following test process:
- Let us identify the test conditions, i.e. the reasons why we test, the aspects we want to check.
- Once we have identified the test conditions, we replace the types of values with real values (integers in our case) and determine the results we should obtain.
Identification of the information mentioned in the specifications (the different inputs and outputs planned) allows us to test the following conditions (valid and invalid outputs):
- a valid equilateral triangle, where the three sides are equal: a, a, a;
- a valid isosceles triangle, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access