Paths

APPROACH Coverage based - process
TEST VARIETY
  • Functional test
  • Suitability
    • for work processes
  • Code structure
  • Security
TEST BASIS Flow with paths and decision points

Description

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.

example 'Paths'

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:

Definition
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:

  1. 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”)

  2. Path combinations
    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.

  3. 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.

example 'Paths'

1. Decision points and paths

Decision points  in/out   Paths
A    in  1,5
   out  2,3
B  in  2,3
   out  4,5
C  in  4
   out  6,7

 

2. Path combinations

Decision Point  Path combinations
A  1-2; 1-3; 5-2; 5-3
B  2-4; 2-5; 3-4; 3-5
C  4-6; 4-7

 

3. Logical test cases

Test case Path Remark
TC-1  1-2-5-3-4-6  Cross out the path combinations covered here.
TC-2  1-3-5-2-4-7  Simply follows from the remaining path combinations.
 

Cross-reference matrix (optional)

 

TC1

TC2

1-2

X

 

1-3

 

X

5-2

 

X

5-3

X

 

2-4

 

X

2-5

X

 

3-4

X

 

3-5

 

X

4-6

X

 

4-7

 

X


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:
 
It is simple to deduce the following from the scheme:

  • Path 1 is the starting point for every test case
  • Paths 2 and 3 are followed by paths 4 and 5
  • Path 5 is followed by paths 2 and 3
  • Path 4 is followed by paths 6 and 7
  • Paths 6 and 7 are end paths and have no sequel. 

 
This can directly extend the path combinations of test depth level 2 to test depth level 3:
 

Decision points Path combinations level 2 Path combinations level 3
A 1-2 1-2-4; 1-2-5
  1-3 1-3-4; 1-3-5
  5-2 5-2-4; 5-2-5
  5-3 5-3-4; 5-3-5
B 2-4 2-4-6; 2-4-7
  2-5 2-5-2; 2-5-3
  3-4 3-4-6; 3-4-7
  3-5 3-5-2; 3-5-3
C 4-6 No extension and already covered.
  4-7 No extension and already covered.

 

In the same way, the test situations of test depth level 3 can be extended to test depth level 4.