Decision Coverage :
Unlike statement coverage, decision coverage covers both the true and false conditions. A decision is an IF statement, a loop control statement or a CASE statement, where there are two or more outcomes from the statement. With an IF statement, the exit can either be TRUE or FALSE, depending on the value of the logical condition that comes after IF.
100% decision coverage guarantees 100% statement coverage, but not the other way around.
Condition Coverage :
Condition coverage is also known as Predicate Coverage.
Condition coverage is used for Boolean expression, condition coverage ensures whether all the Boolean expressions have been evaluated to both TRUE and FALSE.
Let us take an example to explain Condition Coverage
IF (“X && Y”)
In order to suffice valid condition coverage for this pseudo-code following tests will be sufficient.
TEST 1: X=TRUE, Y=FALSE
TEST 2: X=FALSE, Y=TRUE
Note: 100% condition coverage does not guarantee 100% decision coverage.