How to design a test
A test design technique is a standardised method to derive, from a specific test basis, test cases that realise a specific coverage.
The test design leads to a hierarchical structure of test situations – test cases – test scripts. These terms are discussed in detail further on in this section. The creation of test cases follows the following generic steps:
- Identifying test situations
- Creating logical test cases
- Creating physical test cases
- Establishing the starting point
- Creating test script.
These five generic steps are independent of the chosen test design technique and are always applicable. In some cases (becasue of the chosen test design technique or other circumstances) steps can be skipped or merged.
The relationship between the concepts is shown in the figure below and can be summarised as follows:
- Every test situation occurs in at least 1 test case
- A logical test case covers 1 or more test situations
- Every logical test case is worked out concretely into 1 physical test case
- Every physical test case occurs in 1 test script.
The figure also shows the distinction between the logical and physical parts of the test design:
- The logical test design consists of the test situations and the logical test cases. This is the part that demonstrates that the required coverage is achieved, thereby complying with the test strategy.
- The physical test design consists of the concretely created physical test cases, laid down in test scripts. This guarantees a thorough preparation of the ‘execution’ of test cases. The physical creation of test cases therefore adds nothing to the thoroughness of the test.
1. Identifing test situations
The first step of test design is identifying test situations.
A testsituation is an isolated circumstance that has to be tested
In a coverage based approach test situations are derived by applying one or more coverage types. In an experience based test approach test situations are based on knowledge, skill, intuition and experience of a tester.
2. Creating logical test cases
3. Creating physical test cases
The third step of test design is that the logical test cases are sufficiently specified to really execute the test cases. Here we choose the physical value for the test case. A physical test case is a physical translation of a logical testcases, where we attach real values that can be entered into the system under test.
4. Establishing the starting point
The next step is to establish everything that is need for us to execute the newly created physical test case. This starting points entails all the initial situations of the different test cases in the test design, supplemented with everything that is needed to execute the test cases. This is done before the test execution. Think of establisching the right configuration for the test environement, making sure that the right data is present in the database. etc.
On many occacions the starting points of the different tests cases have much in common. In that case one and the same starting point can be a starting point for many tests.
5. Creating the test script
The last step is to create the test script. In this script are test actions and checks of the physical test cases described in an order that is most optimal for test execution. it is important that the different test cases do not influence each others results. The test script is an step by step guide to test execution en helps to keep track of the test progress as well. The physical test cased and the starting point are the basis of the test script that is designed.
A generic test script contains the following items:
- Unique identification, consisiting of:
- test basis including version
- How do I establish the starting point?
- System date
- Restoring the data in the database
- Adding certain test data
- Test actions and check
- Cleaning up the environment
- Making sure that the test environment is back to its original state.