Information Technology Reference
In-Depth Information
ANDed
condition
AGE
SEX
18 False
18 False
19 True
19 True
F False
M True
F False
M True
F False
F False
F False
T True
From this truth table, you can see that a simple branch test that evaluated to the only
true condition and one false condition would miss the two additional test data input
combinations that would evaluate to false … and possibly discovering a logic error.
The truth table becomes larger and more complex with additional Boolean
conditions, allowing more opportunity for missing logic coverage when using only simple
branching coverage. Here is a compound condition with three simple conditions.
((AGE
18 AND SEX
M) OR HEIGHT
6 ft)
There are standard programming language rules for the order of evaluating complex
expressions such as this example. In order to identify the test data for 100% com-
pound condition coverage, the previous example would expand in the following way
using standard Boolean evaluation rules.
ANDed
ORed
AGE
SEX
Condition
HEIGHT
Condition
18 False
F False
F False
16 False
F False
18 False
M True
F False
16 False
F False
19 True
F False
F False
16 False
F False
19 True
M True
T True
16 False
T True
18 False
F False
F False
17 Tr ue
T True
18 False
M True
F False
17 Tr ue
T True
19 True
F False
F False
17 Tr ue
T True
19 True
M True
T True
17 Tr ue
T True
From this truth table, you can see that a simple branch test that evaluated to one true con-
dition and one false condition would miss the six additional test data input combinations
that would evaluate to both true and false … and possibly discovering a logic error.
7.5.4 Path Coverage Technique
Path coverage techniques focus on determining what percentage of the source code
paths in a program have been traversed completely. There are a number of defi nitions
of source code paths in the literature. In its simplest form, a source code path is
the sequence of program statements from the fi rst executable statement through a
Search WWH ::




Custom Search