© SERG Dependable Software Systems (Slicing) Dependable Software Systems Topics in Program Slicing Material drawn from [Weiser84,Gallagher91,DeMillo96]

Slides:



Advertisements
Similar presentations
Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Advertisements

Chapter 4 Ch 1 – Introduction to Computers and Java Flow of Control Loops 1.
Mutation Testing Tim Dakeyne. What is Mutation? Where data is changed a small amount, which may or may not change its function Evolution of life Languages.
DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Chapter 15 Debugging. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Debugging with High Level Languages.
A Survey of Program Slicing Techniques A Survey of Program Slicing Techniques Sections 3.1,3.6 Swathy Shankar
Program Slicing – Based Techniques
Chair of Software Engineering From Program slicing to Abstract Interpretation Dr. Manuel Oriol.
 Program Slicing Long Li. Program Slicing ? It is an important way to help developers and maintainers to understand and analyze the structure.
Program Slicing; Andreas Linder eXtreme Programming lab course 2004.
Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.
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.
Introduction to Program Slicing Presenter: M. Amin Alipour Software Design Laboratory
Csci 565 Spring  Originally proposed by [Weiser 88]and [Gallagher 91] in software maintenance  Useful for  Software Debugging  Software Maintenance.
SwE 455 Program Slicing. Our Goals Debug your thousands lines of code easily by reducing the complexity of the program Write a robust program before testing.
Automated Fitness Guided Fault Localization Josh Wilkerson, Ph.D. candidate Natural Computation Laboratory.
Prepared By: Certified Compliance Solutions, Inc. August 2012
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
272: Software Engineering Fall 2008 Instructor: Tevfik Bultan Lecture 17: Automated Debugging.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
NASA Space Launch System (SLS) Independent Verification and Validation (IV&V) Analysis Processes within Enterprise Architecture (EA) September 11, 2013.
ISSRE 2006 | November 10, 2006 Automated Adaptive Ranking and Filtering of Static Analysis Alerts Sarah Heckman Laurie Williams November 10, 2006.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
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.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Optimizing the SPARK TM Program Slicer Ricky E. Sward and Leemon C. Baird III Dept of Computer Science USAF Academy
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Practical Semantic Test Simplification Sai Zhang University of Washington.
Locating Causes of Program Failures Texas State University CS 5393 Software Quality Project Yin Deng.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Formal Methods Program Slicing & Dataflow Analysis February 2015.
Bug Localization with Machine Learning Techniques Wujie Zheng
Chapter 13: Regression Testing Omar Meqdadi SE 3860 Lecture 13 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Principles of programming languages 5: An operational semantics of a small subset of C Department of Information Science and Engineering Isao Sasano.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Ongoing projects in the Program Analysis Group Marcelo d’Amorim Informatics Center, Federal University of Pernambuco (UFPE) Belo Horizonte, MG-Brazil,
 Program Slicing : Analysis technique of extracting parts of a given program, relevant to the aspects being analyzed (the slicing criterion). E.g. slicing.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Chapter 11: Dynamic Analysis Omar Meqdadi SE 3860 Lecture 11 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CASE/Re-factoring and program slicing
Lecture Notes - Copyright © S. C. Kothari, All rights reserved.1 Efficient Debugging CPRE 556 Lecture 19.
Industrial Project (236504) Advanced programming tools for refactoring Java code in Eclipse Student: Alexander Libov Supervisor: Dr. Ran Ettinger, IBM.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Compiler Optimizations ECE 454 Computer Systems Programming Topics: The Role of the Compiler Common Compiler (Automatic) Code Optimizations Cristiana Amza.
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Mutation Testing Breaking the application to test it.
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
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
By Sasikumar Palanisamy
CSCE 747 Software Testing and Quality Assurance
Chapter One Problem Solving
Testing and Debugging PPT By :Dr. R. Mall.
Faults, Errors, Failures CS 4501 / 6501 Software Testing
SwE 455 Program Slicing.
Mark Weiser University of Maryland, College Park IEEE CHI, 1981
Programming with ANSI C ++
Program Slicing Baishakhi Ray University of Virginia
SAS Essentials How SAS Thinks
CPRE 416-Software Evolution and Maintenance-Lecture 11
C. M. Overstreet Old Dominion University Fall 2005
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:

© SERG Dependable Software Systems (Slicing) Dependable Software Systems Topics in Program Slicing Material drawn from [Weiser84,Gallagher91,DeMillo96]

© SERG Dependable Software Systems (Slicing) What is a Program Slice? A program slice is a subset of a program. Program slicing enables programmers to view subsets of a program by filtering out code that is not relevant to the computation of interest. E.g., if a program computes many things, including the average of a set of numbers, slicing can be used to isolate the code that computes the average.

© SERG Dependable Software Systems (Slicing) Why is Program Slicing Useful? Program slices are more manageable for testing and debugging. When testing, debugging, or understanding a program, most of the code in the program is irrelevant to what you are interested in. Program slicing provides a convenient way of filtering out “irrelevant” code. Program slices can be computed automatically by statically analyzing the data and control flow of the program.

© SERG Dependable Software Systems (Slicing) Definition of Program Slice Assume that: –P is a program. –V is the set of variables at a program location (line number) n. A slice S(V,n) produces the portions of the program that contribute to the value of V just before the statement at location n is executed. S(V,n) is called the slicing criteria.

© SERG Dependable Software Systems (Slicing) A Program Slice Must Satisfy the Following Conditions: Slice S(V,n) must be derived from P by deleting statements from P. Slice S(V,n) must be syntactically correct. For all executions of P, the value of V in the execution of S(V,n) just before the location n must be the same value of V in the execution of the program P just before location n.

© SERG Dependable Software Systems (Slicing) Example: Assume the Following Program... main() { 1. int mx, mn, av; 2. int tmp, sum, num; tmp = readInt(): 5. mx = tmp; 6. mn = tmp; 7. sum = tmp; 8. num = 1; while(tmp >= 0) 11. { 12. if (mx < tmp) 13. mx = tmp; 14. if (mn > tmp) 15. mn = tmp; 16. sum += tmp; num; 18. tmp = readInt(); 19. } av = sum / num; 22. printf(“\nMax=%d”, mx); 23. printf(“\nMin=%d”, mn); 24. printf(“\nAvg=%d”, av); 25. printf(“\nSum=%d”, sum); 26. printf(“\nNum=%d”, num); }

© SERG Dependable Software Systems (Slicing) Slice S(num,26) main() { 2. int tmp, num; 4. tmp = readInt(): 8. num = 1; 10. while(tmp >= 0) 11. { num; 18. tmp = readInt(); 19. } 26. printf(“\nNum=%d”, num); }

© SERG Dependable Software Systems (Slicing) Slice S(sum, 25) main() { 2. int tmp, sum; 4. tmp = readInt(): 7. sum = tmp; 10. while(tmp >= 0) 11. { 16. sum += tmp; 18. tmp = readInt(); 19. } 25. printf(“\nSum=%d”, sum); }

© SERG Dependable Software Systems (Slicing) Slice S(av, 24) main() { 1. int av; 2. int tmp, sum, num; 4. tmp = readInt(): 7. sum = tmp; 8. num = 1; 10. while(tmp >= 0) 11. { 16. sum += tmp; num; 18. tmp = readInt(); 19. } 21. av = sum / num; 24. printf(“\nAvg=%d”, av); }

© SERG Dependable Software Systems (Slicing) Slice S(mn, 23) main() { 1. int mn; 2. int tmp; 4. tmp = readInt(): 6. mn = tmp; 10. while(tmp >= 0) 11. { 14. if (mn > tmp) 15. mn = tmp; 18. tmp = readInt(); 19. } 23. printf(“\nMin=%d”, mn); }

© SERG Dependable Software Systems (Slicing) Slice S(mx, 22) main() { 1. int mx; 2. int tmp; 4. tmp = readInt(): 5. mx = tmp; 10. while(tmp >= 0) 11. { 12. if (mx < tmp) 13. mx = tmp; 18. tmp = readInt(); 19. } 22. printf(“\nMax=%d”, mx); }

© SERG Dependable Software Systems (Slicing) Observations about Program Slicing Given a slice S(X,n) where variable X depends on variable Y with respect to location n: –All d-uses and p-uses of Y before n are included in S(X,n). –The c-uses of Y will have no effect on X unless X is a d-use in that statement. Slices can be made on a variable at any location.

© SERG Dependable Software Systems (Slicing) Program Slicing Process Select the slicing criteria (i.e., a variable or a set of variables and a program location). Generate the program slice(s). Perform testing and debugging on the slice(s). During this step a sliced program may be modified. Merge the modified slice with the rest of the modified slices back into the original program.

© SERG Dependable Software Systems (Slicing) Tools for Program Slicing Spyder –A debugging tool based on program slicing. Unravel –A program slicer for ANSI C.

© SERG Dependable Software Systems (Slicing) References [Weiser84] Weiser, M., Program Slicing, IEEE Transactions on Software Engineering, Vol. SE-10, No. 4, July, [Gallagher91] Gallagher, K. B., Lyle, R. L., Using Program Slicing in Software Maintenance, IEEE Transactions on Software Engineering, Vol. SE-17, No. 8, August, [DeMillo96] DeMillo, R. A., Pan, H., Spafford, E. H, Critical Slicing for Software Fault Localization, Proc International Symposium on Software Testing and Analysis (ISSTA), San Diego, CA, January, 1996.