White-Box Technique
~10 mins
Structure-based or White-Box technique:
1. Statement Coverage or Line Coverage:
- In this technique, every statement in the source code is executed at least once.
- Thereby, we can check what the source code is and is not expected to do. However, we cannot test the false condition in the source code.
Statement coverage = (No. of statements Executed/Total no. of statements in the source code)*100
2. Coverage or Predicate Coverage:
- Condition coverage is seen for Boolean expression.
- Condition coverage ensures whether all the Boolean expressions have been covered and evaluated to both TRUE and FALSE.
3. Decision Coverage or Branch Coverage:
- Test coverage criteria require enough test cases so that each condition in a decision takes on all possible outcomes at least once, and each point of entry to a program or subroutine is invoked at least once.
- That is, every branch (decision) is either true
and false. It is helpful to invalidate all branches in the code to make sure that no branch leads to any abnormal behavior.
4. Multiple Condition Coverage:
- Every combination of ‘true’ or ‘false’ for the conditions related to a decision has to be tested in this technique