Condition-oriented test design

Within almost every IT system, there are decision points where the system behavior can go in different directions, depending on the outcome of such a decision point. A decision consists of one or more conditions. When there's more than one condition, the various combinations of these conditions need to be tested. Variations of these conditions and their outcomes can be tested using coverage types such as decision coverage, modified condition / decision coverage, and multiple condition coverage.

 

Test design techniques for condition-oriented testing

Four test design techniques

In condition-oriented test design we distinguish:

  • Control flow testing
  • Semantic testing
  • Elementary comparison testing
  • Decision table testing

For each of these test design techniques the same coverage types can be applied.

Coverage types for condition coverage

The coverage types that are applicable are:

Generally, CC and DC are less suitable to establish confidence than CDC. To achieve these three types of coverage, the same number of test cases is needed but CDC guarantees both CC and DC. Therefore, in the remainder of this text we focus on CDC, and when you want to achieve higher coverage you can use MCDC and MCC.

  • Condition decision coverage (CDC) covers every condition and every decision outcome once true once false. In general, two test situations give 100% CDC coverage.
  • Modified condition decision coverage (MCDC) makes sure every condition determines every outcome. The minimum number of test situations is the number of conditions + 1.
  • Multiple condition coverage (MCC) covers all combinations of all condition values and therefore achieves the highest coverage but also may require a huge number of test cases. The number of test situations is 2 to the power of the number of conditions.

Within the scope of this section we therefore provide some examples. For more in-depth explanations on these coverage types click the link.

Example of condition decision coverage

In our example of the magic boat ride case, using control flow testing with CDC, test cases are created that have all true and false conditions and all true and false outcomes of the decision. This can generally be done with two test cases. But in our specific example the conditions ≥100 and ≥300 cannot be false at the same time (there is no weight that is <100 and >300 at the same time).

Therefore, in this example we will get three test cases:
1: All conditions true: Two kids of 140 cm weighing 55 kg each, are admitted
2: ≥120 and ≥100 false: Two kids of 100 cm weighing 40 kg each, are not admitted
3: ≥120 and ≥300 false: Six kids of 100 cm weighing 55 kg each, are not admitted

Example of modified condition decision coverage 

In our example of the magic boat ride case, with semantic testing using MCDC:  
Simplify the decision: R = A and B and C  

Create the test situations using a table with three columns, for each decision, for the "true" outcome and for the "false" outcome: 

  1 (true) 0 (false)
A 1.1.1. = ts-1 0.1.1. = ts-2
B 1.1.1. 1.0.1. = ts-3
C 1.1.1. 1.1.0. = ts-4

Every test situation is a test case, so the test cases are:  
ts-1: Group of people, everybody 150 cm, total weight 200 kg, are admitted  
ts-2: Group of people, one is 110 cm, total weight 200 kg, are not admitted  
ts-3: Group of people, everybody 150 cm, total weight 90 kg, are not admitted  
ts-4: Group of people, everybody 150 cm, total weight 350 kg, are not admitted  

Example of multiple condition coverage 

In our example of the magic boat ride case, with decision table testing using MCC, create a table with all combinations of true/false values of every condition

Decision table with three conditions and eight test situations

As per above figure, each of the test situations is translated to a test case:
ts-1: Group of people, everybody 150 cm, total weight 200 kg, are admitted
ts-2: Group of people, everybody 150 cm, total weight 350 kg, are not admitted
ts-3: Group of people, everybody 150 cm, total weight 90 kg, are not admitted
ts-4: Group of people, everybody 150 cm, total weight <100 and >300, impossible
ts-5: Group of people, one is 110 cm, total weight 200 kg, are not admitted
ts-6: Group of people, one is 110 cm, total weight 350 kg, are not admitted
ts-7: Group of people, one is 110 cm, total weight 90 kg, are not admitted
ts-8: Group of people, one is 110 cm, total weight <100 and >300 kg, impossible

The test cases created with MCC also cover all test cases of CDC and MCDC.