(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 1 Data flow testing.

Slides:



Advertisements
Similar presentations
1 Software Unit Test Coverage And Test Adequacy Hong Zhu, Patrick A. V. Hall, John H.R. May Presented By: Arpita Gandhi.
Advertisements

(c) 2007 Mauro Pezzè & Michal Young Ch 5, slide 1 Finite Models.
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
Marking Schema question1: 40 marks question2: 40 marks question3: 20 marks total: 100 marks.
Coverage Criteria Drawn mostly from Ammann&Offutt and Pezze&Yooung.
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.
1 CS 201 Compiler Construction Lecture 3 Data Flow Analysis.
Whitebox Testing Fra: CS Fall Whitebox Testing AKA Structural, Basis Path Test Normally used at unit level Assumes errors at unit level are.
Register Allocation CS 671 March 27, CS 671 – Spring Register Allocation - Motivation Consider adding two numbers together: Advantages: Fewer.
Introduction to Software Engineering Lecture 11 André van der Hoek.
(c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1 Dependence and Data Flow Models.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
West Virginia University SENG 530 Verification & Validation Slide 1 Part III: Execution – Based Verification and Validation Katerina Goseva - Popstojanova.
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.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
(c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Fault-Based Testing.
Sublinear time algorithms Ronitt Rubinfeld Blavatnik School of Computer Science Tel Aviv University TexPoint fonts used in EMF. Read the TexPoint manual.
(c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Structural Testing.
Data Flow Analysis Compiler Design October 5, 2004 These slides live on the Web. I obtained them from Jeff Foster and he said that he obtained.
(c) 2007 Mauro Pezzè & Michal Young Ch 1, slide 1 Software Test and Analysis in a Nutshell.
(c) 2007 Mauro Pezzè & Michal Young Ch 3, slide 1 Basic Principles.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
SOFTWARE TESTING WHITE BOX TESTING 1. GLASS BOX/WHITE BOX TESTING 2.
State coverage: an empirical analysis based on a user study Dries Vanoverberghe, Emma Eyckmans, and Frank Piessens.
Topics in Software Dynamic White-box Testing: Data-flow Testing
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
Software Testing and Validation SWE 434
CMSC 345 Fall 2000 Unit Testing. The testing process.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
Overview Graph Coverage Criteria ( Introduction to Software Testing Chapter 2.1, 2.2) Paul Ammann & Jeff Offutt.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
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 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.
Paul Ammann & Jeff Offutt
Software TestIng White box testing.
Structural Testing.
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
CompSci 230 Software Construction
Paul Ammann & Jeff Offutt
Structural testing, Path Testing
Graph Coverage for Design Elements CS 4501 / 6501 Software Testing
White-Box Testing Techniques II
Dataflow Testing G. Rothermel.
White-Box Testing Techniques II
Graph Coverage for Design Elements CS 4501 / 6501 Software Testing
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Graph Coverage for Source Code
Paul Ammann & Jeff Offutt
Graph Coverage Criteria
Data Flow Analysis Compiler Design
Pointer analysis.
Graph Coverage Criteria CS 4501 / 6501 Software Testing
White-Box Testing Techniques II
Graph Coverage Criteria
Paul Ammann & Jeff Offutt
Building SSA Harry Xu CS 142 (b) 04/22/2018.
George Mason University
Paul Ammann & Jeff Offutt
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:

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 1 Data flow testing

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 2 Learning objectives Understand why data flow criteria have been designed and used Recognize and distinguish basic DF criteria –All DU pairs, all DU paths, all definitions Understand how the infeasibility problem impacts data flow testing Appreciate limits and potential practical uses of data flow testing

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 3 Motivation Middle ground in structural testing –Node and edge coverage don’t test interactions –Path-based criteria require impractical number of test cases And only a few paths uncover additional faults, anyway –Need to distinguish “important” paths Intuition: Statements interact through data flow –Value computed in one statement, used in another –Bad value computation revealed only when it is used

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 4 Data flow concept x =.... if.... x = y = x Value of x at 6 could be computed at 1 or at 4 Bad computation at 1 or 4 could be revealed only if they are used at 6 (1,6) and (4,6) are def-use (DU) pairs –defs at 1,4 –use at

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 5 Terms DU pair: a pair of definition and use for some variable, such that at least one DU path exists from the definition to the use x =... is a definition of x =... x... is a use of x DU path: a definition-clear path on the CFG starting from a definition to a use of a same variable –Definition clear: Value is not replaced on path –Note – loops could create infinite DU paths between a def and a use

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 6 Definition-clear path 1,2,3,5,6 is a definition- clear path from 1 to 6 –x is not re-assigned between 1 and 6 1,2,4,5,6 is not a definition-clear path from 1 to 6 –the value of x is “killed” (reassigned) at node 4 (1,6) is a DU pair because 1,2,3,5,6 is a definition-clear path x =.... if.... x = y = x

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 7 Adequacy criteria All DU pairs: Each DU pair is exercised by at least one test case All DU paths: Each simple (non looping) DU path is exercised by at least one test case All definitions: For each definition, there is at least one test case which exercises a DU pair containing it –(Every computed value is used somewhere) Corresponding coverage fractions can also be defined

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 8 Difficult cases x[i] =... ;... ; y = x[j] –DU pair (only) if i==j p = &x ;... ; *p = 99 ;... ; q = x –*p is an alias of x m.putFoo(...);... ; y=n.getFoo(...); –Are m and n the same object? –Do m and n share a “foo” field? Problem of aliases: Which references are (always or sometimes) the same?

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 9 Data flow coverage with complex structures Arrays and pointers are critical for data flow analysis –Under-estimation of aliases may fail to include some DU pairs –Over-estimation, on the other hand, may introduce unfeasible test obligations For testing, it may be preferrable to accept under- estimation of alias set rather than over-estimation or expensive analysis –Controversial: In other applications (e.g., compilers), a conservative over-estimation of aliases is usually required –Alias analysis may rely on external guidance or other global analysis to calculate good estimates –Undisciplined use of dynamic storage, pointer arithmetic, etc. may make the whole analysis infeasible

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 10 Infeasibility Suppose cond has not changed between 1 and 5 Or the conditions could be different, but the first implies the second Then (3,5) is not a (feasible) DU pair But it is difficult or impossible to determine which pairs are infeasible Infeasible test obligations are a problem No test case can cover them if (cond) x = y = x if (cond)

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 11 Infeasibility The path-oriented nature of data flow analysis makes the infeasibility problem especially relevant –Combinations of elements matter! –Impossible to (infallibly) distinguish feasible from infeasible paths. More paths = more work to check manually. In practice, reasonable coverage is (often, not always) achievable –Number of paths is exponential in worst case, but often linear –All DU paths is more often impractical

(c) 2007 Mauro Pezzè & Michal Young Ch 13, slide 12 Summary Data flow testing attempts to distinguish “important” paths: Interactions between statements Intermediate between simple statement and branch coverage and more expensive path-based structural testing Cover Def-Use (DU) pairs: From computation of value to its use Intuition: Bad computed value is revealed only when it is used Levels: All DU pairs, all DU paths, all defs (some use) Limits: Aliases, infeasible paths Worst case is bad (undecidable properties, exponential blowup of paths), so pragmatic compromises are required