Loading

Decision Coverage or Modified Condition


What is Decision Coverage?

Decision coverage is also called branch coverage or modified coverage and sometimes it is also called as all edges coverage. It process both true and false conditions which is considered as statement coverage. Conceptually, a branch is an outcome of decision, in this context, a branch coverage measures what number of decisions should be tested. This process of covering branches acts as an advantage because it executes in-depth source code analysis for better outcome.

It is also known by a testing approach, the major aim is to ensure that each of the possible number of branches from a particular decision point should be executed at least once. And lastly, there should be a validation check to ensure all the branches have been covered.

Ultimately, this valuable process defines the behaviour of the application. In this coverage, the decision is in the form of If statement or loop control statement such as do-while or repeat-until or case statement.

Decision condition coverage or modified condition coverage increases the condition criteria that shown in their independent outcome. The designing strategy requires more thoughtful effort for selection of test cases which is carried out from integrated components.

Characteristics

  1. Entry and exit point in a program should be invoked at least once.
  2. Each decision should be tested for every possible number of outcomes of branch.
  3. Each condition acts as a decision in a program. It should have taken all possible number of outcomes at once.
  4. Each condition in a decision has shown an individual impact on decision outcome.

Calculation of Decision Coverage

The basic calculative formula is given below:

Decision Coverage = (Number of decision outcomes exercised / Total number of decision outcomes) *100

Many times, it may be seen that decision coverage requires an independent outcome in the form of true and false. To achieve complete coverage, it is necessary to follow descriptive methods appropriately. As a whole, it can be observed that 100% decision coverage ensures 100% statement coverage.

Example

READ A

READ B

IF A + B > 10 then

PRINT "A + B is Large"

ENDIF

IF A > 5 then

PRINT "A Large"

ENDIF

Logic Diagram Representation

decision coverage image

Reault:

The above flow chart diagram shows a qualitative approach to functions a value from top to bottom. Each directed link holds a different value such as 1, 2, 3, 4 and 5 of A, B, C, D, E, F, G, H. To calculate branch coverage, it is important to find minimum number of paths which are such as:

  1. 1A-2C-3D-E-4G-5H
  2. 1A-2B-E-4F

Therefore, the final decision coverage is 2.

Conclusion

It can be noted that 100% of decision coverage guarantees 100% statement coverage. But it 100% of statement may not guarantee 100% of decision coverage.