Decision coverage only cares about the value of the judgment expression (true/false), while conditional coverage involves the value of each condition of the judgment expression (true/false).
Give the simplest example for easy understanding: (Recommended learning: PHP video tutorial)
Judgment expression: a>1 or b>1
Use judgment to cover the designed test data:
a=5 (Judgment expression The value of the expression is "true")
a=0 (The value of the expression is determined to be "false")
There is no need to control the value of b here, just The conditions for determining coverage have been met.
Cover the designed test data with conditions:
a=5 (the value of condition a>1 is "true")
a=0 (The value of condition a>1 is "false")
b=5 (The value of condition b>1 is "true")
b=0 (The value of condition b>1 is "false")
The value of the expression a>1 or b>1 is not considered here, but it must be The values of the two conditions a>1 and b>1 are considered.
For more PHP related technical articles, please visit the PHP Graphic Tutorial column to learn!
The above is the detailed content of The difference between decision coverage and conditional coverage. For more information, please follow other related articles on the PHP Chinese website!