Structural testing

ersaranya 8,224 views 9 slides Nov 20, 2012
Slide 1
Slide 1 of 9
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9

About This Presentation

No description available for this slideshow.


Slide Content

Structural Testing Saranya.V AP/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 Coverage Path Coverage Branch Coverage Condition Coverage

1. Statement Coverage Weakest form of testing. Because this kind of testing requires that every statement in the code has been executed at least once. Ex: Begin If(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 Testing IF ("X && Y ") TEST 1: X=TRUE, Y=FALSE TEST 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 = True A = True, B = False A = False, B = True A = False, B = False

4. Path Coverage Testing Paths 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
Tags