Ch2-1-2-overviewGraphCoverage

Ch2-1-2-overviewGraphCoverage - Ch. 2 : Graph Coverage...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria www.introsoftwaretesting.com Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 2 Ch. 2 : Graph Coverage Four Structures for Four Structures for Modeling Software Modeling Software Graphs Graphs Logic Logic Input Space Input Space Syntax Use cases Specs Design Source Applied to DNF Specs Specs FSMs Source Source Applied to Input Input Models Models Integ Source Applied to Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 3 Covering Graphs (2.1) Graphs are the most commonly used structure for testing Graphs can come from many sources Control flow graphs Design structure FSMs and statecharts Use cases Tests usually are intended to “cover” the graph in some way Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 4 Definition of a Graph A set N of nodes , N is not empty A set N 0 of initial nodes , N 0 is not empty A set N f of final nodes , N f is not empty A set E of edges , each edge from one node to another ( n i , n j ), i is predecessor, j is successor Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 5 Three Example Graphs 0 2 1 3 N 0 = { 0 } N f = { 3 } 0 2 1 3 N 0 = { } N f = { 3 } 9 0 4 3 7 1 5 8 2 6 N 0 = { 0, 1, 2 } N f = { 7, 8, 9 } Not a Not a valid graph Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 6 Paths in Graphs Path : A sequence of nodes – [n 1 , n 2 , …, n M ] Each pair of nodes is an edge Length : The number of edges A single node is a path of length 0 Subpath : A subsequence of nodes in p is a subpath of p Reach ( n ) : Subgraph that can be reached from n 9 7 8 0 1 2 4 3 5 6 Paths [ 0, 3, 7 ] [ 1, 4, 8, 5, 1 ] [ 2, 6, 9 ] Reach (0) = { 0, 3, 4, 7, 8, 5, 1, 9 } Reach ({0, 2}) = G Reach([2,6]) = {2, 6, 9}
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 7 Test Paths and SESEs Test Path : A path that starts at an initial node and ends at a final node Test paths represent execution of test cases Some test paths can be executed by many tests Some test paths cannot be executed by any tests SESE graphs : All test paths start at a single node and end at another node Single-entry, single-exit N0 and Nf have exactly one node 0 2 1 6 3 5 4 Double-diamond graph Four test paths [ 0, 1, 3, 4, 6 ] [ 0, 1, 3, 5, 6 ] [ 0, 2, 3, 4, 6 ] [ 0, 2, 3, 5, 6 ] Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com 8 Visiting and Touring Visit : A test path p visits node n if n is in p A test path p visits edge e if e is in p Tour : A test path ptours subpath q if q is a subpath of p Path [ 0, 1, 3, 4, 6 ] Visits nodes 0, 1, 3, 4, 6
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/29/2010 for the course CS 514 taught by Professor Prof.j.bieman during the Fall '09 term at Colorado State.

Page1 / 6

Ch2-1-2-overviewGraphCoverage - Ch. 2 : Graph Coverage...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online