1. Structural Testing
Saranya.V
AP/CSE,
Sri Vidya College of Engineering & Technology,
Virudhunagar
2. Test cases based upon the structure of the
code under testing.
Stronger than other testing methodologies.
Complementary Testing:
Testing strategy (A) detects some errors.
Testing strategy (B) detects some more errors
which is uncovered by (A). This is known as
complementary testing strategy.
4. 1. Statement Coverage
Weakest form of testing.
Because this kind of
testing requires that Begin
every statement in the
code has been executed
at least once. yes
Ex: Y>=0 Y=0-y
Begin
If(y>= 0) then y=0-y; No
Abc=y; Abc=y
end
5. 2. Branch Coverage
Test cases are generated to test each branch
condition assume true or false values in turn.
Also known as Edge Testing.
Edge of the programs control flow graph is
traversed at least once.
These kind of test cases checks Branches of
decision box.
6.
7. 3. Condition Coverage Testing
• Check all possible
combinations of IF ("X && Y")
conditions.
• While branch TEST 1: X=TRUE,
coverage is stronger
than statement Y=FALSE
coverage, its not TEST 2: X=FALSE,
suitable for multiple Y=TRUE
conditions checking.
8. • Example: “if (A or B)” requires 4 test cases:
A = True, B = True
A = True, B = False
A = False, B = True
A = False, B = False
9. 4. Path Coverage Testing
Paths in the program executed
at least once. 1 2
Independent path can be P1 F
T
defined in terms of CFG.
White box testing is used here.
P2 F
Test the each independent path. T
But this process will be complex
one when the loop occurs.