Data Flow Testing Chapter 10. 2 Data Flow Testing Testing All-Nodes and All-Edges in a control flow graph may miss significant test cases Testing All-Paths.

Slides:



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

Overview Structural Testing Introduction – General Concepts
Analysis of programs with pointers. Simple example What are the dependences in this program? Problem: just looking at variable names will not give you.
West Virginia University SENG 530 Verification & Validation Slide 1 Part III: Execution – Based Verification and Validation Katerina Goseva - Popstojanova.
ECE453/SE465 Prof. Alencar University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2007 Based on the tutorials by Prof. Kontogiannis, Winter.
Csci 565 Spring  Originally proposed by [Weiser 88]and [Gallagher 91] in software maintenance  Useful for  Software Debugging  Software Maintenance.
Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt
Lecture 2 White-box Testing and Structural Coverage.
Data Flow Testing (DFT) Data flow testing is NOT the same as constructing Design Diagrams in the form of data-flow-diagrams (DFD) or E-R diagrams. It is.
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.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
Nov. 17, Verification and Validation F Verification: checks that the program conforms to its specification. –Are we building the product right?
Software Testing and Quality Assurance
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
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
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
Path Testing + Coverage Chapter 9 Assigned reading from Binder.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
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.
Final Review  Different tests  Boundary Value Testing  Equivalence Class Testing  Decision Table Based Testing  Path Testing  Data Flow & P-Slice.
Implementation-Based Testing Review Class 9 Implementation-based Testing CEN 5076 Class 10 – 11/07.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
White-Box Software Testing Methods Speaker: Jerry Gao Ph.D. San Jose State University URL:
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
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
Theory and Practice of Software Testing
Structural Testing Review Chapter Measuring Gaps and Redundancy We have seen that functional testing methods may produce test suites with serious.
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.
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)
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.
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
CSCE 747 Software Testing and Quality Assurance
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Paul Ammann & Jeff Offutt
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Data Flow Testing.
Structural testing, Path Testing
White Box 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
Graph Coverage for Source Code
White-Box Testing Techniques II
Paul Ammann & Jeff Offutt
If AD = 10, DC =6, and ED = 15, find DB.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Data Flow Testing Chapter 10

2 Data Flow Testing Testing All-Nodes and All-Edges in a control flow graph may miss significant test cases Testing All-Paths in a control flow graph is often too time-consuming Can we select a subset of these paths that will reveal the most faults? Data Flow Testing focuses on the points at which variables receive values and the points at which these values are used

3 Data Flow Analysis Can reveal interesting bugs A variable that is defined but never used A variable that is used but never defined A variable that is defined twice before it is used Paths from the definition of a variable to its use are more likely to contain bugs

4 Definitions A node in the program graph is a defining node for variable v if the value of v is defined at the statement fragment in that node Input, assignment, procedure calls A node in the program graph is a usage node for variable v if the value of v is used at the statement fragment in that node Output, assignment, conditionals

5 More Definitions A usage node is a predicate use (P-Use) if variable v appears in a predicate expression A usage node is a computation use (C-Use) if variable v appears in a computation A definition-use path (du-path) with respect to a variable v is a path whose first node is a defining node for v, and its last node is a usage node for v A du-path with no other defining node for v is a definition-clear path (dc-path)

6 int max = 0; int i = s.nextInt(); while (i > 0) if (i > max) { max = i; } i = s.nextInt(); } System.out.println(max); An Example Definitions of max A definition of i A C-use of i P-uses of i

int max = 0; int i = s.nextInt(); while (i > 0) System.out.println(max); max = i; if (i > max) i = s.nextInt(); Definitions and uses of variable i

8 du-paths in example Variable i AB, AC, AD, EB, EC, ED Variable max AF, AC, DC, DF

9 Data Flow Coverage Metrics Based on these definitions we can define a set of coverage metrics for a set of test cases We have already seen All-Nodes All-Edges All-Paths

10 All-Defs Criterion For every variable v For every defining node d of v There exists at least one test case that follows a path from d to a usage node of v

11 All-Uses Criterion For every variable v For every defining node d of v For every usage node u of v There exists at least one test case that follows a path from d to u

12 All-P-Uses / Some-C-Uses For every variable v For every defining node d of v For every P-Use u of v There exists at least one test case that follows a path from d to u If there is no P-Use of v, there must exist at least one test case that follows a path from d to a C-Use of v

13 All-C-Uses / Some-P-Uses For every variable v For every defining node d of v For every C-Use u of v There exists at least one test case that follows a path from d to u If there is no C-Use of v, there must exist at least one test case that follows a path from d to a P-Use of v

All-Paths All-DU-Paths All-Uses All-C-Uses Some-P-Uses All-Defs All-P-Uses All-Edges All-Nodes All-C-Uses Some-P-Uses

15 Data flow analysis issues Aliasing of variables causes serious problems! Working things out by hand for anything but small methods is hopeless Compiler-based tools help in determining coverage values