Csci 565 Spring 2009.  Originally proposed by [Weiser 88]and [Gallagher 91] in software maintenance  Useful for  Software Debugging  Software Maintenance.

Slides:



Advertisements
Similar presentations
Overview Structural Testing Introduction – General Concepts
Advertisements

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.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Bernstein’s Conditions. Techniques to Exploit Parallelism in Sequential Programming Hierarchy of levels of parallelism: Procedure or Methods Statements.
Systems V & V, Quality and Standards
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
 Program Slicing Long Li. Program Slicing ? It is an important way to help developers and maintainers to understand and analyze the structure.
Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.
© SERG Dependable Software Systems (Slicing) Dependable Software Systems Topics in Program Slicing Material drawn from [Weiser84,Gallagher91,DeMillo96]
ECE453/SE465 Prof. Alencar University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2007 Based on the tutorials by Prof. Kontogiannis, Winter.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Functional Testing 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 01 – Functional Testing.
Factor Analysis There are two main types of factor analysis:
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
Computer Science 1620 Programming & Problem Solving.
Testing an individual module
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Chapter 20 The Budgeting Process.
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.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
CHAPTER 5 COST – VOLUME - PROFIT Study Objectives
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.
VTT-STUK assessment method for safety evaluation of safety-critical computer based systems - application in BE-SECBS project.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
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.
SOFTWARE DESIGN.
10 ITK261 The traditional approach to design Reading: Chapter 10 Oct 9, 11.
Agenda Introduction Overview of White-box testing Basis path testing
Software Design Design is the process of applying various techniques and principles for the purpose of defining a device, a process,, or a system in sufficient.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Overview Structural Testing Introduction – General Concepts
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
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.
1 Software Testing & Quality Assurance Lecture 5 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.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Software Dynamic White-box Testing Part 2: Data-flow Testing Lecture 7 Prof. Mostafa Abdel Aziem Mostafa.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
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.
Subject Name: Software Testing Subject Code: 10CS842 Prepared By:
BASIS PATH TESTING.
CSCE 747 Software Testing and Quality Assurance
Software Testing.
Software Testing.
Data Flow Testing.
SwE 455 Program Slicing.
Mark Weiser University of Maryland, College Park IEEE CHI, 1981
Designing and Debugging Batch and Interactive COBOL Programs
A Survey of Program Slicing Techniques: Section 4
Program Slicing Baishakhi Ray University of Virginia
Software Testing (Lecture 11-a)
Chapter 10 Data Flow Testing Slice Testing
Graph Coverage for Source Code
Overview Functional Testing Boundary Value Testing (BVT)
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:

Csci 565 Spring 2009

 Originally proposed by [Weiser 88]and [Gallagher 91] in software maintenance  Useful for  Software Debugging  Software Maintenance  Program understanding  Quantification of functional cohesion

 A complementary method of program decomposition that applied after the program is written/designed  Purpose  Debugging (subset of behavior is fixed)  Maintenance (subset of program is improved)  Works on actual program  Specify program behaviors using a sets of variables at some set of statements

 Slicing criterion for a program specifies a windows for observing its behavior  Where a window ▪ specified as a statement and a set of variables ▪ Allows the observations of values of the specified variables before execution of particular statement ▪ E.g., S(x, 24) (i.e., value of x at line 24)

 The Commission Problem Statement Locks cost $45.00, stocks cost $30.00, and barrels cost $25.00  Rifle salesperson in the Arizona Territory sold rifle locks, stocks, and barrels made by a gunsmith in Missouri. Locks cost $45.00, stocks cost $30.00, and barrels cost $ Salespersons had to sell at least one complete rifle per month, and production limits are such that the most one salesperson could sell in one month is 70 locks, 80 stocks, 90 barrels. Each rifle salesperson sent a telegram to the Missouri company with the total order for each town s/he visits; salespersons visit at least one town per month, but travel difficulties made ten towns the upper limit. At the end of each month, the company computed commission as follows: ▪ 10% on sales up to $1000 ▪ 15% on the next $800 ▪ 20% on any sales in excess of $1800.  The company had four salespersons. The telegram from each salesperson were sorted into piles (by person) and at the end of each month a data file is prepared, containing the salesperson's name, followed by one line for each telegram order, showing the number of locks, stocks, and barrels in that order. At the end of the sales data lines, there is an entry of “-1” in the position where the number of locks would be to signal the end of input for that salesperson. The program produces a monthly sales report that gives the salesperson’s name, the total number of locks, stocks, and barrels sold, the salesperson's total dollar sales, and finally his/her commission.

Lock has a predicate usage

 Slice-based Testing technique  divide a program into components (or slices)  A program slice?  Refers to a set of program statements that may affect the computation of variable v at statement s

 Given a program P, a program graph G(P) in which statements are numbered, and a set V of variables in P, the slice on the variable set V at statement n, S(V,n) prior to ncontribute to  the set node (or line) numbers of all statements fragments in P prior to n that contribute to the values of variables in V at statement fragment n

 For statement s and variable v, the slice of program P w.r.t. the slicing criterion includes only those statements of P needed to contribute (or influence) to the behavior of v at s.

 1Y := X  2Z := Y  The value of X before the first statement can contribute to the value of Z after second ▪ S(Z,2)

 The notion of contribution can be described by the USE relationship (e.g., C-use and P- use)  P-use: used in a predicate (decision)  C-use: used in computation (assignment)  O-use: used for output (write/print, etc.)  L-use: used for location (e.g., pointers/subscripts)  I-use: iteration (e.g., internal counter)

 Definition nodes can be refined  I-def  I-def: defined by input (e.g., read)  A-def  A-def: defined by assignment statements (e.g., a:= x + y)

 There are two properties in a slice  The slice must have been obtained from the original program by statement deletion  The behavior of the slice must correspond to the behavior of program as observed through the window of the slicing criterion

 By removing the source code of a program, we may obtain slice that is not grammatically correct  E.g. removing the THEN clause from an IF-THEN- ELSE block

Important guideline for node inclusion in the slice: 1.If statement n is a defining node for v, the n is included in the slice 2.If statement n is a usage node for v, then n is NOT included in the slice 3.P-use/c-use of other variables are included if they their execution has some affects on the value of the variable v loop

Consider the slice S 5, which is S(locks,23)={22,23,24,29,30} This slice contains the following statements:

If we add statement 1-14 and 53, then we can compile the slice as follows:

 Using SBT,  Program is decomposed into set of mini- programs or functions which are easier to test  The focus can be made on the most interesting parts of a program (smaller and/or simpler) or parts that implements properties  difficult using du-paths because du-paths are sequences that include both statements and variables

1. Never make a slice S(V,n) for which variables v  V do not appear in statement fragment n 2. Make slices on one variable 3. Make slices for all A-def nodes e.g., S 27 :S(sales,36)={3,4,5,19,20,21,22,23,24,25,26,27,28, 29,30,36} P-use node 4. Make slices for P-use node because the slice shows how the predicate variable gets its value 5. Stay away from non P-use slices 6. Consider making slices compile-able (executable)`

 Metrics may include  Coverage: compares the lengths of slices to the length of the entire program ▪ Ratio of mean slice length to program length ▪ a low coverage value indicates a long program with many shorts slices (or properties )  Coupling (statements common to all slices)  Parallelism ( slices having a very few elements in common)

 [Rapps 85] S. Rapps and E. Weyuker. Selecting software test data using data flow information. IEEE Transaction on Software Eng., vol.se-11, no.4, pp: , April,  [Frankl 88] P. Frankl and E. Weyuker. An Applicable Family of Data Flow Testing Criteria. IEEE Transaction on software eng., vol.14, no.10, October  [Weyuker 88] E. Weyuker. The evaluation of Program-based software test data adequacy criteria. Communication of the ACM, vol.31, no.6, June  [Jorgenson 95]. Software Testing: A Craftsman’s Approach. CRC publication,  [Jorgenson 02]. Software Testing: A Craftsman’s Approach. CRC publication, 2002, 2 nd edition.  [Weiser 88]. M. D. Weiser. Program slicing. IEEE Transaction on software eng. Vol.10, no.4, pg: , April  [Gallagher 91] K. B. Gallagher, and J. R. Lye. Using program slicing in software maintenance. IEEE Transaction on Software Eng., vol.17, no.8, pg: