Ch2-1-2-overviewGraphCoverage

Ch2-1-2-overviewGraphCoverage - Introduction to Software...

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

View Full Document Right Arrow Icon
1 Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwaretest/ Ch. 2 : Graph Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Applied to FSMs Source Applied to Applied to Introduction to Software Testing (Ch 2) © Ammann & Offutt 2 Use cases Specs Design Source DNF Specs Input Models Integ Source
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 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) © Ammann & Offutt 3 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) © Ammann & Offutt 4
Background image of page 2
3 Three Example Graphs 0 0 0 1 2 2 1 2 1 4 3 5 6 Not a valid graph Introduction to Software Testing (Ch 2) © Ammann & Offutt 5 3 N 0 = { 0 } N f = { 3 } 3 N 0 = { } N f = { 3 } 9 7 8 N 0 = { 0, 1, 2 } N f = { 7, 8, 9 } 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 0 1 2 A Few Paths Reach (0) = { 0, 3, 4, 78519 Introduction to Software Testing (Ch 2) © Ammann & Offutt 6 9 7 8 4 3 5 6 [ 0, 3, 7 ] [ 1, 4, 8, 5, 1 ] [ 2, 6, 9 ] 7, 8, 5, 1, 9 } Reach ({0, 2}) = G Reach([2,6]) = {2, 6, 9}
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 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 e ec ted b man test 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 Introduction to Software Testing (Ch 2) © Ammann & Offutt 7 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 ] 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 p tours subpath q if q is a subpath of p Path [ 0, 1, 3, 4, 6 ] Visits nodes 0, 1, 3, 4, 6 Visits edges (0, 1), (1, 3), (3, 4), (4, 6) Introduction to Software Testing (Ch 2) © Ammann & Offutt 8 Tours subpaths [0, 1, 3], [1, 3, 4], [3, 4, 6], [0, 1, 3, 4], [1, 3, 4, 6]
Background image of page 4
5 Tests and Test Paths path ( t ) : The test path executed by test t path T : The set of test paths executed by the set of tests T ( ) : The set of test paths executed by the set of tests Each test executes one and only one test path A location in a graph (node or edge) can be reached from another location if there is a sequence of edges from the first Introduction to Software Testing (Ch 2) © Ammann & Offutt 9
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course SWE 637 taught by Professor Offutt,j during the Fall '08 term at George Mason.

Page1 / 16

Ch2-1-2-overviewGraphCoverage - Introduction to Software...

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

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