1 / 20

Chapter 9: Path Testing

Chapter 9: Path Testing. Csci 565 Spring 2009. Objectives. Decision-to-decision path (DD-Paths) Test Coverage Metrics Basis Path Testing Observation on McCabe Basis Path Method Essential Complexity. f. t. t. f. f. f. f. Test Selection Criteria (white box).

chanda-kim
Download Presentation

Chapter 9: Path Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. f t t f f f f

  4. 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%

  5. 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 2N tests

  6. Basis Path Testing

  7. 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

  8. 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)

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

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

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

More Related