Home >Common Problem >The difference between decision coverage and conditional coverage

The difference between decision coverage and conditional coverage

(*-*)浩
(*-*)浩Original
2019-07-25 15:24:2624908browse

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).

The difference between decision coverage and conditional coverage

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn