Professional Documents
Culture Documents
White Box Basics - Part 1: Introduction To Coverage
White Box Basics - Part 1: Introduction To Coverage
Introduction to Coverage
Statements
Branches
Paths
Conditions
CAUTION
Mickey Mouse
structure
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – Simple Structure
if condition-1
if condition-1
then
operation-A
if condition-1
then
operation-A
else
operation-B
if condition-1
then
operation-A
else
operation-B
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
Testcase #3 will execute operation-C
then
condition-2 has to be TRUE to reach the operation
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
3 Testcases
???
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – Simple Structure
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
The upper and the lower part of the program are completely independent
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
if condition-1 if condition-1
then then
operation-A operation-A
else else
operation-B operation-B
endif endif
if condition-2 if condition-2
then then
operation-C operation-C
endif endif
if condition-1 if condition-1
then then
operation-A operation-A
else else
operation-B operation-B
endif endif
if condition-2 if condition-2
then then
operation-C operation-C
endif endif
NOT REALLY
There is an
uncovered branch
There is an
uncovered
condition
There is an
uncovered branch
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – Simple Structure
TESTCAS condition-1 condition-2
#1E TRUE TRUE
#2 FALSE does not matter
if condition-1
then
operation-A
else
operation-B
endif
if condition-2
then
operation-C
endif
NOT SO BAD
IT DEPENDS…
Can we do more ?
#1
#2
#3
#4
OH YES IT IS
www.drschneider.at
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
Take Advantage of 30+ Years of IT Experience !