ECE453/SE465 Prof. Alencar University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2007 Based on the tutorials by Prof. Kontogiannis, Winter.

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
Advertisements

Selection Process If … then … else.... Condition Process 2 Process 1 Y.
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
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Chapter 6 Path Testing Software Testing
Engineering EG167C - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
Principles of programming languages 4: Parameter passing, Scope rules Department of Information Science and Engineering Isao Sasano.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
Csci 565 Spring  Originally proposed by [Weiser 88]and [Gallagher 91] in software maintenance  Useful for  Software Debugging  Software Maintenance.
ECE 453/ SE 465 Prof. Alencar University of Waterloo 1 Examples on Functional Testing Winter 2007 Based on the tutorials by Prof. Kontogiannis, Winter.
Examples on Functional Testing
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.
CS447/ECE453/SE465 Prof. Alencar University of Waterloo 1 CS447/ECE453/SE465 Software Testing Tutorial Winter 2008 Based on the tutorials by Prof. Kontogiannis,
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
COMP1170 Midterm Preparation (March 17 th 2009) Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
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.
Constant Propagation. The constant propagation framework is different from all the data-flow problems discussed so far, in that It has an unbounded set.
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
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.
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
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.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Path Testing + Coverage Chapter 9 Assigned reading from Binder.
1 The CONST definition CONST Pi = , City = ‘New York’; Constant identifiers are used when you do not want the value of an identifier to change why.
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.
Final Review  Different tests  Boundary Value Testing  Equivalence Class Testing  Decision Table Based Testing  Path Testing  Data Flow & P-Slice.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 12P. 1Winter Quarter User-Written Functions Lecture 12.
Overview Structural Testing Introduction – General Concepts
1 More on Readln:numerical values Note: ENTER key counts sends a carriage return and a line feed to the computer definition: “white space”: space, tab,
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Software Dynamic White-box Testing Part 2: Data-flow Testing Lecture 7 Prof. Mostafa Abdel Aziem Mostafa.
ECE 453, Prof. Kontogiannis University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2006 Presented by Nikos Giannopoulos
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
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
CSCE 747 Software Testing and Quality Assurance
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Paul Ammann & Jeff Offutt
Principles of programming languages 4: Parameter passing, Scope rules
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Data Flow Testing.
SwE 455 Program Slicing.
Chapter 14: Dynamic Data Structures
Paul Ammann & Jeff Offutt
CHAPTER 4 Test Design Techniques
Dataflow Testing G. Rothermel.
Constructing and Using
Program Slicing Baishakhi Ray University of Virginia
Chapter 10 Data Flow Testing Slice Testing
Paul Ammann & Jeff Offutt
White-Box Testing Techniques II
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:

ECE453/SE465 Prof. Alencar University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2007 Based on the tutorials by Prof. Kontogiannis, Winter 2006 Presented by Akhilesh Kumar, Aleh Smalyanau

ECE453/SE465 2University of Waterloo Agenda Slice-Based Testing Definitions Slice-Based Testing Definitions Slice-Based Testing Examples Slice-Based Testing Examples

ECE453/SE465 3University of Waterloo Agenda  Slice-Based Testing Definitions Slice-Based Testing Examples Slice-Based Testing Examples

ECE453/SE465 4University of Waterloo Slice-Based Testing Definitions Given a program P, and a program graph G(P) in which statements and statement fragments are numbered, and a set V of variables in P, the slice on the variable set V at statement fragment n, written S(V,n), is the set node numbers of all statement fragments in P prior to n that contribute to the values of variables in V at statement fragment n Given a program P, and a program graph G(P) in which statements and statement fragments are numbered, and a set V of variables in P, the slice on the variable set V at statement fragment n, written S(V,n), is the set node numbers of all statement fragments in P prior to n that contribute to the values of variables in V at statement fragment n The idea of slices is to separate a program into components that have some useful meaning The idea of slices is to separate a program into components that have some useful meaning

ECE453/SE465 5University of Waterloo Slice-Based Testing Definitions We will include CONST declarations in slices We will include CONST declarations in slices Five forms of usage nodes Five forms of usage nodes P-use (used in a predicate (decision)) P-use (used in a predicate (decision)) C-use (used in computation) C-use (used in computation) O-use (used for output, e.g. writeln()) O-use (used for output, e.g. writeln()) L-use (used for location, e.g. pointers) L-use (used for location, e.g. pointers) I-use (iteration, e.g. internal counters) I-use (iteration, e.g. internal counters) Two forms of definition nodes Two forms of definition nodes I-def (defined by input, e.g. readln()) I-def (defined by input, e.g. readln()) A-def (defined by assignment) A-def (defined by assignment) For now, we presume that the slice S(V,n) is a slice on one variable, that is, the set V consists of a single variable, v For now, we presume that the slice S(V,n) is a slice on one variable, that is, the set V consists of a single variable, v

ECE453/SE465 6University of Waterloo Slice-Based Testing Definitions If statement fragment n (in S(V,n)) is a defining node for v, then n is included in the slice If statement fragment n (in S(V,n)) is a defining node for v, then n is included in the slice If statement fragment n (in S(V,n)) is a usage node for v, then n is not included in the slice If statement fragment n (in S(V,n)) is a usage node for v, then n is not included in the slice P-uses and C-uses of other variables are included to the extent that their execution affects the value of the variable v P-uses and C-uses of other variables are included to the extent that their execution affects the value of the variable v O-use, L-use, and I-use nodes are excluded from slices O-use, L-use, and I-use nodes are excluded from slices Consider making slices compilable Consider making slices compilable

ECE453/SE465 7University of Waterloo Agenda Slice-Based Testing Definitions Slice-Based Testing Definitions  Slice-Based Testing Examples

ECE453/SE465 8University of Waterloo Slice-Based Testing Examples Find the following program slices Find the following program slices S(commission,48) S(commission,48) S(commission,40) S(commission,40) S(commission,39) S(commission,39) S(commission,38) S(commission,38) S(sales,35) S(sales,35) S(num_locks,34) S(num_locks,34) S(num_stocks,34) S(num_stocks,34) S(num_barrels,34) S(num_barrels,34)

ECE453/SE465 9University of Waterloo Slice-Based Testing Examples S(commission,48) S(commission,48) {1-5,8-11,13,14, 19-30,36,47,48,53} {1-5,8-11,13,14, 19-30,36,47,48,53} S(commission,40), S(commission,39), S(commission,38) S(commission,40), S(commission,39), S(commission,38) {Ø} {Ø} S(sales,35) S(sales,35) {Ø} {Ø}

ECE453/SE465 10University of Waterloo Slice-Based Testing Examples S(num_locks,34) S(num_locks,34) {1,8,9,10,13,14,19, 22,23,24,26,29,30, 53} {1,8,9,10,13,14,19, 22,23,24,26,29,30, 53}

ECE453/SE465 11University of Waterloo Slice-Based Testing Examples S(num_stocks,34) S(num_stocks,34) {1,8,9,10,13,14,20, 22-25,27,29,30,53} {1,8,9,10,13,14,20, 22-25,27,29,30,53}

ECE453/SE465 12University of Waterloo Slice-Based Testing Examples S(num_barrels,34) S(num_barrels,34) {1,8,9,10,13,14, ,28,29,30,53} {1,8,9,10,13,14, ,28,29,30,53}

ECE453/SE465 13University of Waterloo Slice-Based Testing Examples Find the program slice on FinalUse(low). Use the Program Dependency Graph approach Find the program slice on FinalUse(low). Use the Program Dependency Graph approach int binSearch(int x, int v[], int n) { {1} int low = 0; {2} int high = n – 1; {3} int mid; {4} while (low <= high) { {5} mid = (low + high) / 2; {6} mid = (low + high) / 2; {6} if (x < v[mid]) {7} if (x < v[mid]) {7} high = mid – 1; {8} else if (x > v[mid]) {9} else if (x > v[mid]) {9} low = mid + 1; {10} else {11} else {11} return mid; {12} } {13} return -1; {14} } {15}

ECE453/SE465 14University of Waterloo Slice-Based Testing Examples Program Dependency Graph

ECE453/SE465 15University of Waterloo Slice-Based Testing Examples Slice based on the criterion FinalUse(low)

ECE453/SE465 16University of Waterloo Slice-Based Testing Examples int binSearch(int x, int v[], int n) { {1} int low = 0; {2} int high = n – 1; {3} int mid; {4} while (low <= high) { {5} mid = (low + high) / 2; {6} mid = (low + high) / 2; {6} if (x < v[mid]) {7} if (x < v[mid]) {7} high = mid – 1; {8} else if (x > v[mid]) {9} else if (x > v[mid]) {9} low = mid + 1; {10} else {11} else {11} return mid; {12} } {13} return -1; {14} } {15} int binSearch(int x, int v[], int n) { {1} int low = 0; {2} int high = n – 1; {3} int mid; {4} while (low <= high) { {5} mid = (low + high) / 2; {6} mid = (low + high) / 2; {6} if (x < v[mid]) {7} if (x < v[mid]) {7} high = mid – 1; {8} else if (x > v[mid]) {9} else if (x > v[mid]) {9} low = mid + 1; {10} } {13} } {15} → Slice on FinalUse(low)

ECE453/SE465 17University of Waterloo Agenda Slice-Based Testing Definitions Slice-Based Testing Definitions Slice-Based Testing Examples Slice-Based Testing Examples

ECE453/SE465 18University of Waterloo References Software Testing A Craftsman's Approach 2nd edition, Paul C. Jorgensen, CRC Press (Chapter 10 (10.2)) Software Testing A Craftsman's Approach 2nd edition, Paul C. Jorgensen, CRC Press (Chapter 10 (10.2))