Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 9: Path Testing Csci 565 Spring 2009. Objectives  Decision-to-decision path (DD-Paths)  Test Coverage Metrics  Basis Path Testing  Observation.

Similar presentations


Presentation on theme: "Chapter 9: Path Testing Csci 565 Spring 2009. Objectives  Decision-to-decision path (DD-Paths)  Test Coverage Metrics  Basis Path Testing  Observation."— Presentation transcript:

1 Chapter 9: Path Testing Csci 565 Spring 2009

2 Objectives  Decision-to-decision path (DD-Paths)  Test Coverage Metrics  Basis Path Testing  Observation on McCabe Basis Path Method  Essential Complexity

3

4

5

6

7

8

9 t f t f f f f

10 Test Selection Criteria (white box)  Test Selection Criteria  Help us to measure the adequacy of a test suite  E.g. if we use statement coverage to test 40% of the code, it means 60 percent of code was never executed  Help us to decide when to stop testing  E.g., use other criteria to cover 85%

11 Overview of the families of test selection criteria  Families of test selection criteria include  Structural model coverage criteria  All statements (AS),  All Decisions (AD),  All paths (AP)  AP  AD  AS  Condition coverage (CC)  A test set achieves CC when each condition in the program is tested with a true result and false results  Decision/CC (D/CC)  A test set achieves D/CC when it achieves both AD and CC  Multiple condition coverage (MCC)  A test set achieves MCC if it exercises all possible combinations of condition outcomes in each decision  For N conditions, it requires 2 N tests

12 Basis Path Testing

13

14 ex1= p2+p3-p1 Ex1= (1,0,1,2,0,0,0,0,1,0) +(1,0,0,0,1,0,0,1,0,1)-(1,0,0,1,0,0,0,0,1,0) Ex1 = (1,0,1,1,1,0,0,1,0,1)=A,B,C,B,E,F,G ex2=2p2-p1 Ex2=(2,0,2,4,0,0,0,0,2,0) – (1,0,0,1,0,0,0,0,1,0)= (1,0,2,3,0,0,0,0,1,0)=A,B,C,B,C,B,C,G

15 McCabe’s Algorithmic Procedure  McCable’s Algorithmic Procedure can be used to identify a set of basis paths  Select a path with highest number of decision nodes  Retrace each decision in baseline path  Flip each decision to create a new path  E.g.  P1: A,B,C,B,E,F,G  A,D,E,F,G (flip p1 at A)  A,,B,E,F,G (flip p1 at B)  A,B,C,G (flip p1 at C)

16 Observations on McCabe’s Basis Path Is testing Basis path enough? Infeasible paths

17 Essential Complexity V(G)=1  wellStr(P) V(G) >=10 requires substantial testing Use the characteristics of code to select appropriate criteria

18

19

20 Reference  Material in this presentation is taken from the following resources:  Paul C. Jorgensen. Software Testing: A Craftsman’s Approach, 3 rd Edition. Auerbach Publication, 2008


Download ppt "Chapter 9: Path Testing Csci 565 Spring 2009. Objectives  Decision-to-decision path (DD-Paths)  Test Coverage Metrics  Basis Path Testing  Observation."

Similar presentations


Ads by Google