1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.

Slides:



Advertisements
Similar presentations
DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Advertisements

Overview Structural Testing Introduction – General Concepts
A Survey of Program Slicing Techniques A Survey of Program Slicing Techniques Sections 3.1,3.6 Swathy Shankar
Data Flow Coverage. Reading assignment L. A. Clarke, A. Podgurski, D. J. Richardson and Steven J. Zeil, "A Formal Evaluation of Data Flow Path Selection.
Overview Discrete Mathematics for Testers Set Theory Functions
Paul Ammann & Jeff Offutt
Graph Coverage (2).
Graph Coverage Criteria Structural Coverage Criteria : Defined on a graph just in terms of nodes and edges Data Flow Coverage Criteria : Requires a graph.
Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt
The Application of Graph Criteria: Source Code  It is usually defined with the control flow graph (CFG)  Node coverage is used to execute every statement.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
Dependable Software Systems
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Topics in Software Dynamic White-box Testing: Data-flow Testing
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 9 Instructor Paulo Alencar.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Topics in Software Dynamic White-box Testing Part 2: Data-flow Testing
Data Flow Testing Data flow testing(DFT) is NOT directly related to the design diagrams of data-flow-diagrams(DFD). It is a form of structural testing.
Software testing techniques Testing criteria based on data flow
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
Data Flow Testing Chapter Data Flow Testing Testing All-Nodes and All-Edges in a control flow graph may miss significant test cases Testing All-Paths.
White-Box Testing Techniques II Originals prepared by Stephen M. Thebaut, Ph.D. University of Florida Dataflow Testing.
14004 L8 - © D. Deugo, 2003 – 2008 Testing Procedures (You MUST bring Binder chapter 10)
Overview Graph Coverage Criteria ( Introduction to Software Testing Chapter 2.1, 2.2) Paul Ammann & Jeff Offutt.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
1 Software Testing & Quality Assurance Lecture 14 Created by: Paulo Alencar Modified by: Frank Xu.
Coverage Estimating the quality of a test suite. 2 Code Coverage A code coverage model calls out the parts of an implementation that must be exercised.
Software Verification Graph Model. 2 Graph Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases Specs Design Source.
Software Testing and Maintenance Lecture 2.1 Overview Graph Coverage
Overview Structural Testing Introduction – General Concepts
1 Graph Coverage (3). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section 2.2 ◦ Section
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Control Flow Graphs : The if Statement 1 if (x < y) { y = 0; x = x + 1; } else { x = y; } x >= yx < y x = y y = 0 x = x + 1 if (x < y) { y = 0;
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Paul Ammann & Jeff Offutt
Data Flow Coverage Criteria
Data Flow Testing. Introduction to Software Testing (Ch 2) © Ammann & Offutt 2 Definition of a Graph A set N of nodes, N is not empty A set N 0 of initial.
Software Dynamic White-box Testing Part 2: Data-flow Testing Lecture 7 Prof. Mostafa Abdel Aziem Mostafa.
Chapter 2 : Graph Coverage (part 2)
CS223: Software Engineering Lecture 26: Software Testing.
ECE 453, Prof. Kontogiannis University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2006 Presented by Nikos Giannopoulos
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Paul Ammann & Jeff Offutt
CS223: Software Engineering
CSCE 747 Software Testing and Quality Assurance
Paul Ammann & Jeff Offutt
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Software Testing and Maintenance 1
Paul Ammann & Jeff Offutt
Graph Coverage Criteria CS 4501 / 6501 Software Testing
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Paul Ammann & Jeff Offutt
Data Flow Testing.
White-Box Testing Techniques II
White-Box Testing Techniques II
Chapter 10 Data Flow Testing Slice Testing
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Paul Ammann & Jeff Offutt
Graph Coverage Criteria CS 4501 / 6501 Software Testing
Graph Coverage Criteria
White-Box Testing Techniques II
Graph Coverage Criteria
Paul Ammann & Jeff Offutt
George Mason University
Paul Ammann & Jeff Offutt
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis

2 Overview  Structural Testing  Introduction – General Concepts  Flow Graph Testing  Data Flow Testing  Definitions  Some Basic Data Flow Analysis Algorithms  Define/use Testing  Slice Based Testing  Guidelines and Observations  Hybrid Methods  Retrospective on Structural Testing

3 Data Flow Testing – Basic Idea Data-flow testing involves selecting entry/exit paths with the objective of covering certain data definition and use patterns, commonly known as data-flow criteria An outline of data-flow testing is as follows: –Draw a data flow graph for the program –Select data-flow testing criteria –Identify paths in the data-flow graph to satisfy the selection criteria (i.e. all-defs, all-uses, all-P-uses/some-C-uses etc.) –Produce test cases for the selected paths

4 Some Definitions (1) Node n in the CFG of program P is a defining node of the variable v V, written as DEF(v, n), iff the value of the variable v is unambiguously defined at the statement fragment corresponding to node n. Node n in the CFG of program P is a usage node of the variable v V, written as USE(v, n), iff the value of the variable v is used at the statement fragment corresponding to node n.

5 Some Definitions (2) A usage node USE(v, n), is a predicate use (denoted as P-use) iff the statement n is a predicate statement, otherwise USE(v, n) is a computation use or C-use The nodes corresponding to predicate uses have always an outdegree ≥ 2, and nodes corresponding to computation uses always have outdegree ≤ 1

6 Some Definitions (3) A definition-use (sub)path with respect to a variable v (denoted as du-path) is a (sub)path in PATHS(P), where PATHS(P) is the set of all possible paths in the CFG of program P, such that, for some v in V, there are define and usage nodes DEF(v, m) and USE(v, n) such that m, and n are the initial and final nodes in the path respectively. A definition-clear (sub)path with respect to a variable v (denoted as dc-path) is a definition-use path in PATHS(P) with initial nodes DEF(v, m) and USE(v, n) such that there no other node in the path is a defining node for v

7 Some Definitions (4) A global definition is a definition of a variable x in node n if there is a definition of x in node n and there is a definition-clear path from n to some node m containing a global c-use of x, or containing a p-use of x. Note x is live at n A global c-use of variable x in node n is a c-use of variable x in node n and x has been defined in a node other than n

8 Some Definitions (5) Simple path is a path in which all nodes except possibly the first and the last are distinct Loop free path is a path in which all nodes are distinct Complete path is a path from the entry node to the exit node of the CFG Du-Path with respect to variable x at node n 1 is a path [n 1, n 2, …. n k ] where n 1 has a global definition of x and either –Node n k has a global c-use of x and [n 1 ….n k ] is def-clear simple path with respect to x or, –Node n k has a p-use of x and [n 1 ….nj] is a def-clear loop-free path with respect to x

9 Define / Use Information Example VariableDefined atUsed atComment locks9Declaration locks22READ locks23Predicate use locks26Computation Use stocks9READ stocks27Computation Use num_locks26Assignment num_locks26Computation Use num_locks33WRITE

10 DU-Path Test Coverage Criteria The basic idea is to use def-use information as defined in the previous slides and specific criteria in order to obtain specific paths in the CFG graph. These paths will then help us define specific test cases Let T be a set of feasible complete paths in the program’s P CFG, and V be the set of all variables in the program P

11 DU-Path Coverage Criteria (1) The set T satisfies the All-Defs criterion for a program P iff for every variable v in V, T contains definition clear (sub)paths from every defining node of v to a use of v. Note: Reaching definitions set) The set T satisfies the All-Uses criterion for the program P iff for every variable v in V, T contains definition-clear (sub)paths from every defining node of v to every use of v, and to the successor node of each USE(v, n) Note: def-use chains set We can distinguish between an All-C-Uses, or an All-P- Uses set

12 DU-Path Coverage Criteria (2) The set T satisfies the All-P-Uses/Some-C-Uses criterion for a program P iff for every variable v in V, T contains definition-clear (sub)paths from every defining node of v to every p-use of v, and if a definition of v has no p-uses, there is a definition-clear path to at least one c-use The set T satisfies the All-C-Uses/Some-P-Uses criterion for a program P iff for every variable v in V, T contains definition-clear (sub)paths from every defining node of v to every c-use of v, and if a definition of v has no c-uses, there is a definition-clear path to at least one p-use The set T satisfies the All-DU-Paths criterion for the program P iff for every variable v in V, T contains definition-clear (sub)paths from every defining node of v to every use of v, and to the successor node of each USE(v, n), and that these paths are either

13 Example public static double ReturnAverage(int value[], int AS, int MIN, int MAX) { int i, ti, tv, sum; double av; i = 0; ti = 0; tv = 0; sum = 0; while (ti < AS && value [i] != -999) { ti++; if (value[i] >= MIN && value[i} <= MAX) { tv++; sum = sum + value[i]; } i++; } if (tv > 0) av = (double) sum/tv; else av = (double) -999; return (av) }

14 Example Initialize: value[] AS, MIN, MAX i=0; ti=0; tv=0, sum=0 ((ti < AS) && (value[i] != -999)) tv > 0 av = (double) -999 av = (double) sum/tv return(av) ti++; (value[i] >= MIN && value[i] <= MAX) F F F T T T tv++; sum= sum+value[i] i

15 Examples Global c-use of variable tv : node 9 (tv is defined in nodes 2 and 5) Def-clear paths with respect to variable tv: , Simple paths: and All-defs criterion paths for tv: – , and with p-uses – and All-c-uses criterion paths for ti: – , – , – , – All-p-uses criterion paths for tv: – – – – All-p-uses/some-c-uses criterion paths for i: All-c-uses/some-p-uses criterion paths for AS: All-uses: Conjuction of all-c-uses and all-p-uses All-du-paths for tv: …