|APPROACH||Coverage based - process|
|TEST BASIS||Flow with paths and decision points|
The coverage of paths is applicable if the system behaviour is described with the aid of decision points and paths. Charts of decision points and paths (see movie) show, in a structured way, how the process runs from start to end and what the various possibilities in the course of the process are: At each decision point, the process can go various ways, indicated by the various paths that continue from the particular decision point. The conditions under which it takes one path or another are described in the decision points themselves.
The aim of the coverage type described here is to cover the variations in the process run that are possible according to the chart. The test situations are described in this case by indicating which paths in the chart should be followed consecutively.
Keep in mind that such charts with decision points and paths do not necessarily have to be about the functionality of the system. Security processes or work procedures in business processes can also be described with such charts, which makes the basic technique described here applicable to other test types.
Levels of coverage: the test depth level
In the coverage of paths, various levels are possible. The more thorough the level, the greater the probability of finding defects. This is explained below. The most elementary form of path coverage only provides the guarantee that each path has been travelled once. The test situations consist in this case of every individual path.
In our example, these are the test situations: 1; 2; 3; 4; 5; 6; 7
A test case is a completed whole that goes through the process run from "Start" to "End". The above-mentioned test situations can, for example, be covered with the following 2 logical test cases:
TC1 = 1 2 5 3 4 6
TC2 = 1 3 4 7
Going through the process from “Start” to “End”, covering only each individual path, will finds all the faults that will always occur in a particular path. However, it is not for certain that faults that only occur with a specific combination of process steps will be found in this way.
In order to find this type of fault, testing has to be more thorough. The depth of coverage is reflected in the concept of test depth level:
Test depth level N = the certainty that all the combinations of N consecutive paths are covered.
The test depth level in principle runs from 1 to unlimited. The higher the test depth level, the greater the certainty that even faults that occur in complex compositions of process steps will be found. A higher test depth level implies a lower test depth level. In other words, a higher test depth level will at any rate find all the faults that can be found with a lower test depth level, plus possible additional faults.
Deriving the test situations for test depth level 1 is easy. The basic technique for obtaining test depth level 2 is described below. Subsequently, it is explained how higher test depth levels can be derived simply from test depth level 2.
Obtaining test situations with test depth level 2
Irrespective of the test depth level, the starting point for this technique requires a test basis that describes the system behaviour in terms of decision points and paths. The following steps are then carried out:
Decision points & paths
Nominate the decision points in the process scheme (A, B, etc.) and number the paths. Sum up, per decision point, the:
a. Incoming paths (“IN”)
b. Outgoing paths (“OUT”)
Working out all the combinations of “IN” and “OUT” at each decision point. With a number of incoming P paths and outgoing Q paths, this leads to P times Q path combinations.
Logical test cases
Creation of logical test cases, until all the path combinations are covered.
Each logical test case begins at "Start" and finishes at "End", running through various path combinations.
The first 2 steps lead to the test situations in the test design. They are all the variations (in this case, path combinations) that have to be tested in order to reach test depth level 2.
Step 3 leads to a set of logical test cases that are guaranteed to cover all the test situations. The tester is free to create a set of test cases that comply with this. If necessary, it can be shown with the aid of a cross-reference matrix that all the test situations are covered with the chosen set of test cases. In principle, there are two ways of arriving at a covering set of test cases:
- Working from the process chart, define a test case by running through the process in a particular way from "Start" to "End". The tester is in principle free to choose the exact way of going through the process. Cross out of the list of path combinations every combination that occurs in this test case. Repeat this process until the list of path combinations is completely crossed out.
- Working from the list of path combinations, start with a path combination that begins at "Start" (e.g. "1-3"). Seek a subsequent path combination that starts with the path with which the previous one ends (e.g. a "3-5") – like setting down domino tiles, in fact. Continue seeking a subsequent path combination until "End" has been reached. Obviously, previously unused path combinations should be used as much as possible.
The steps are now explained using the example image.
In more detail:
Breakdown of test depth level 2 for the scheme from the example image.
1. Decision points and paths
2. Path combinations
3. Logical test cases
Cross-reference matrix (optional)
Deriving test situations for higher test depth levels
For higher test depth levels, the following simple mechanism is used:
- Use the list of path combinations of the preceding test depth level as a basis
- Extend each path combination by every possible subsequent step in the course of the process.
It may be formulated as:
Test depth level (N+1) = Test depth level N + “1 step further in the course of the process”.
In the same way, the test situations of test depth level 3 can be extended to test depth level 4, etc.
In more detail:
Test depth level 3 from the chart in the Figure above:
In the same way, the test situations of test depth level 3 can be extended to test depth level 4.
Wiki's - Coverage types:
- Right paths / fault paths
- Decision points
- Equivalence classes
- Boundary value analysis
- Orthogonal arrays and pairwise testing