Structural testing
-
Upload
slideshare -
Category
Education
-
view
1.900 -
download
1
description
Transcript of Structural testing
Structural Testing
Saranya.VAP/CSE,
Sri Vidya College of Engineering & Technology,Virudhunagar
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.
Categories of Structural Testing
Statement CoveragePath CoverageBranch CoverageCondition Coverage
Weakest form of testing.Because this kind of
testing requires that every statement in the code has been executed at least once.
Ex:BeginIf(y>= 0) then y=0-y;Abc=y;end
yes
No
Begin
Y>=0
Abc=y
Y=0-y
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.
3. Condition Coverage TestingIF ("X && Y")
TEST 1: X=TRUE, Y=FALSETEST 2: X=FALSE, Y=TRUE
• Check all possible combinations of conditions.
• While branch coverage is stronger than statement coverage, its not suitable for multiple conditions checking.
• Example: “if (A or B)” requires 4 test cases:A = True, B = TrueA = True, B = FalseA = False, B = TrueA = False, B = False
4. Path Coverage TestingPaths in the program executed at
least once. Independent path can be defined
in terms of CFG.White box testing is used here.Test the each independent path.But this process will be complex
one when the loop occurs.
1 2
T F
T F
P1
P2