structural testing
DESCRIPTION
TRANSCRIPT
![Page 1: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/1.jpg)
Structural Testing
Saranya.VAP/CSE,
Sri Vidya College of Engineering & Technology,Virudhunagar
![Page 2: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/2.jpg)
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.
![Page 3: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/3.jpg)
Categories of Structural Testing
Statement CoveragePath CoverageBranch CoverageCondition Coverage
![Page 4: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/4.jpg)
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
![Page 5: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/5.jpg)
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.
![Page 6: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/6.jpg)
![Page 7: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/7.jpg)
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.
![Page 8: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/8.jpg)
• Example: “if (A or B)” requires 4 test cases:A = True, B = TrueA = True, B = FalseA = False, B = TrueA = False, B = False
![Page 9: Structural testing](https://reader035.vdocument.in/reader035/viewer/2022081820/5468c1a5af7959317f8b5c82/html5/thumbnails/9.jpg)
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