Program Slicing: Theory and Practice Tibor Gyimóthy Department of Software Engineering University of Szeged.

Slides:



Advertisements
Similar presentations
Java Solutions for Cheminformatics June 2007 Company and product overview.
Advertisements

IBM Haifa Research Lab © 2007 IBM Corporation Program Sliding A Novel Approach for the Automation of Slicing-Based Refactoring June 2007 Ran Ettinger In.
Refactoring via Program Slicing and Sliding Ran Ettinger Programming Tools Group University of Oxford In Panayas Reading Group 2 November, 2006.
WWW May EC Semantic Web Research Current Activities Horst Forster European Commission DG Information Society and Media Directorate E « Content.
HURO/0901/ SZEGED - TIMISOARA AXIS FOR THE SAFE FOOD AND FEED SZETISA1 Disclaimer The content of this page does not necessarily represent the official.
Environmental Democracy Conference Pázmány Péter Catholic University Faculty of Law Jean Monnet Centre of Excellence October 19, 2012 Budapest.
NATIONAL PLATFORM ACTIVITIES OF HUNGARY László RUPPERT dr. managing director
INTRODUCING the SZÉCHENYI ISTVÁN UNIVERSITY. The university from bird’s eye view.
”Big Data” Initiative as an IT Solution for Improved Operation and Maintenance of Wind Turbines Zsolt János Viharos, Csaba István Sidló, András A. Benczúr,
Machine Learning and its Application to Speech Impediment Therapy.
S ZILVIA N AGY ASSOCIATE PROFESSOR VICE DEAN FOR RESEARCH AND INTERNATIONAL RELATIONS – F ACULTY OF E NGINEERING S CIENCES R ICHÁRD H ORVÁTH ASSISTANT.
NDJ / Learning to Learn Dr Nilüfer Demirkan-Jones ELTC Spring 2006 Session 4.
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.
May By Annmaria Taylor, May 2006 The rate of reinfection within a major City community based Chlamydia Screening Programme Liverpool: City of Culture.
Best Practice: „Gran Prize” Interdisciplinary Innovation Award Best Practice: „Gran Prize” Interdisciplinary Innovation Award.
Advanced Manufacturing Office Meeting of the Interagency Network of Enterprise Assistance Providers (INEAP) June 27, 2012 Dr. Leo Christodoulou Program.
Overview Structural Testing Introduction – General Concepts
Dependence Analysis in Reduction of Requirement Based Test Suites Boris Vaysburg Luay Tahat Bogdan Korel Computer Science Department Bell Labs Innovations.
A note on ‘Einstein's special relativity beyond the speed of light by James M. Hill and Barry J. Cox’ by Hajnal Andréka, Judit X. Madarász, István Németi,
FAMOUS HUNGARIANS quiz. FOOTBALLER AND MANAGER, ALSO PLAYED FOR REAL MADRID: A)Ferenc Puskás B)Balázs Dzsudzsák C) Ádám Szalai.
Quantitative Characterization of the Large-Scale Association of ErbB1 and ErbB2 by Flow Cytometric Homo-FRET Measurements Ágnes Szabó, Gábor Horváth, János.
Attila Andics, Márta Gácsi, Tamás Faragó, Anna Kis, Ádám Miklósi 
Intraprocedural Static Slicing of Binary Executables
Tracy Hall, Brunel University David Bowes, University of Hertfordshire Andrew Kerr, University of Hertfordshire.
Computer Engineering People. © Computer Engineering Department – KFUPMSlide 2 COE People Faculty Professors Associate Professors Assistant Professors.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 1 Introduction Jan Maluszynski, IDA, 2007
We Use Open Source: Now what? Marty J. Wolf Mathematics and Computer Science Department Bemidji State University Bemidji, MN USA Copyright, Marty.
Key Traits of a Good Software Developer David Dunn Presented 4/20/10.
Spatially and Temporally Synchronized Atomic Force and Total Internal Reflection Fluorescence Microscopy for Imaging and Manipulating Cells and Biomolecules.
Applying to a British University. All applications to UK universities are made through UCAS (the Universities and Colleges Admissions Service) fill in.
Robust Reinforcement Learning Control Chuck Anderson, Matt Kretchmar, Department of Computer Science, Peter Young, Department of Electrical and Computer.
October 6, 2004.Software Technology Forum 1 The Renaissance of Compiler Development Com piler optimizations motivated by embedded systems Tibor Gyimóthy.
UNIVERSITAS SCIENTIARUM SZEGEDIENSIS UNIVERSITY OF SZEGED D epartment of Software Engineering New Conceptual Coupling and Cohesion Metrics for Object-Oriented.
computer
Departments in Business Business Name 1 Business Name 2.
Core operation and Concepts By: Mariam obaid muftah & Mariam muftah & amany.
Hungarian Pancreatic Study Group – Magyar Hasnyálmirigy Munkacsoport 4 th Conference of the Hungarian & 2 nd Conference of the Eastern and Central European.
Software Engineering Department Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms Árpád Beszédes, Tamás Gergely and Tibor Gyimóthy University.
Introduction The design, development and maintenance of concurrent software are difficult tasks. Truly effective support methodologies have yet to be developed.
Second Floor, Civic Offices Friar Street Cashel Co Tipperary Telephone: Childcare – Changes to Free Pre-school.
SCAM’08 -- Evaluating Key Statements AnalysisZheng Li Evaluating Key Statements Analysis David Binkley - Loyola College, USA Nicolas Gold, Mark Harman,
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
Folk-dance The dance house movement is 40 years old in Hungary. The first was in 1972 in Budapest. In a dance house anybody can learn to dance. There is.
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
“Entrepreneurship and Seed Future” Expanding new Entrepreneurship Ideology and Methodology in the startup World Sponsorship offering Contact: Ágnes Kiss.
Evaluating C++ Design Pattern Miner Tools Lajos Jenő Fülöp 1, Tamás Gyovai 2 and Rudolf Ferenc 1 1 Department of Software Engineering University of Szeged,
Synthesis, structural characterisation and catalytic testing of bioinspired electron transfer catalysts István Pálinkó Department of Organic Chemistry,
Master’s program in mathematics Eötvös Loránd University Budapest.
Improving the quality of learning in Portsmouth December 2006 – June 2008.
STRUCTURES TC STUDENT PAPERS SUBCOMMITTEE REPORT JAN 5 TH, 2016 PAVANA PRABHAKAR ASSISTANT PROFESSOR, DEPARTMENT OF MECHANICAL ENGINEERING THE UNIVERSITY.
Algebra. JUNE 2005 JAN 2006 JAN 2007 JUNE 2009.
ΜΕΤΑΣΥΛΛΕΚΤΙΚΗ ΦΥΣΙΟΛΟΓΙΑ ΕΡΓΑΣΤΗΡΙΟ 3. Μετασυλλεκτική Εργ3-Λιοσάτου Γ.2 ΒΙΟΛΟΓΙΚΟΙ ΠΑΡΑΓΟΝΤΕΣ ΠΟΥ ΕΠΗΡΕΑΖΟΥΝ ΤΗ ΦΘΟΡΑ ΤΩΝ ΟΠΩΡΟΚΗΠΕΥΤΙΚΩΝ Αναπνοή Η λειτουργία.
The risk of lymphoma and immunomodulators in patients with inflammatory bowel diseases: Results from a population-based cohort in Eastern Europe  Peter.
Risk of colorectal cancer and small bowel adenocarcinoma in Crohn's disease: A population-based study from western Hungary 1977–2008  Peter Laszlo Lakatos,
Diagnostic yield of upper endoscopy in paediatric patients with Crohn's disease and ulcerative colitis. Subanalysis of the HUPIR registry  Marta Kovacs,
Esmolol is noninferior to metoprolol in achieving a target heart rate of 65 beats/min in patients referred to coronary CT angiography: A randomized controlled.
Gergely Molnár, András Zénó Gyöngyösi, and Tamás Gál
Anti-tumor necrosis factor-α induced systemic lupus erythematosus in a patient with metastatic Crohn's disease—what is the role of anti-TNF antibody? 
References & Acknowledgements
نظرية التضخم THE THEORY OF INFLATION
The Department of Electrical and Computer Engineering welcomes you to…
اثرات گرمايش جهاني تغييرات آب و هوا، تأثيرات عميق و شديدي بر بسياري از عوامل اساسي موثر بر سلامت از جمله : آب، غذا، هوا و محيط زيست دارد كه اين مورد خود.
B1 long answer questions
Le Moyne College Summer Math Academy
Diagnostic yield of upper endoscopy in paediatric patients with Crohn's disease and ulcerative colitis. Subanalysis of the HUPIR registry  Marta Kovacs,
computer languages and ms office
( OFFICE TOOLS AND JAVA USING NETBEANS)
Preparation of Poster for the 4th IEEC 2019
Overview of Computer system
Presentation transcript:

Program Slicing: Theory and Practice Tibor Gyimóthy Department of Software Engineering University of Szeged

CSCS June 2006 Co-authors Árpád Beszédes David Binkley(USA) Bogdan Korel(USA) János Csirik Sebastian Danacic(UK) Csaba Faragó István Forgács Peter Fritzson(S) Tamás Gergely Tamás Horváth Mark Harman(UK) Judit Jász Mariam Kamkar(S) Ákos Kiss Gyula Kovács Ferenc Magyar Jan Maluszynski(S) Jukka Paakki(FI) Nahid Shahmehri(S) Zsolt Szabó Attila Szegedi Gyöngyi Szilágyi

CSCS June 2006 Motivation Primary initial goal of slicing was to assist with debugging. Programmers naturally form program slices,mentally, when they debug and understand programs. A program slice consists of the parts of a program that potentially affect the values computed at some point of interest (slicing criteria).

CSCS June x=1; 2. i=0; 3. while (i<2) { 4. i++; 5. if (i<2) 6. x=2; else 7. x=3; 8. z=x; } Example

CSCS June 2006 Example Slicing criterion: (8,z) Which statements have a direct or inderect effect on variable z. Backward slice consists of all statements that the computation at the slicing criteria may depend on. Forward slice includes all statements depending on the slicing criterion. Static slice: all possible executions of the program are taken into account. Dynamic slice is constructed with respect to only one execution of the program (iteration number is taken into account). Dynamic slicing criteria: (x,i,V,k). Example (_,8,z,2)

CSCS June 2006 Slicing methods Weiser’s original approach: iteration of dataflow equations (executable slices) The most popular approaches are based on dependency graphs (non-executable slices) Slicing is a simple graph reachability problem

CSCS June 2006 Program Dependence Graph 1. x=1; 2. i=0; 3. while (i<2) { 4. i++; 5. if (i<2) 6. x=2; else 7. x=3; 8. z=x; }

CSCS June 2006 Interprocedural Slicing (Calling context problem) Proc AProc BProc C(x,y) ……… Call C(a,b)Call C(d,e)y=x ……… end

CSCS June 2006 Interprocedural Slicing (Calling context problem)

CSCS June 2006 Interprocedural Slicing (Calling context problem) Summary edges represent the transitive dependences due to procedure calls. Slices are computed by doing a two phase traversing on the System Dependence Graph. The main problem is the effective computation of the summary edges. Forgács I, Gyimóthy T: An Efficient Interprocedural Slicing Method for Large Programs, Proceedings of SEKE'97, the 9th International Conference on Software Engineering & Knowledge Engineering, 1997, Madrid, Spain, pp2287

CSCS June 2006 Slicing approaches for programming languages  Logic programs Gyimóthy, T., Paakki, J.: Static Slicing of Logic Programs, Proceedings of AADEBUG'95, 2nd International Workshop on Automated and Algorithmic Debugging, St. Malo, France, May 1995, IRISA/INSA, (Ed. Ducassé, M.), pp Gy. Szilágyi, J. Maluszynski and T. Gyimóthy. Static and Dynamic Slicing of Constraint Logic Programs. Journal Of Automated Software Engineering, 9 (1), 2002, pp  Binary programs Á. Kiss, J. Jász and T. Gyimóthy. Using Dynamic Information in the Interprocedural Static Slicing of Binary Executables. Software Quality Journal, 13 (3), September 2005, pp , Springer Science Business Media, 2005.Using Dynamic Information in the Interprocedural Static Slicing of Binary Executables.  Java programs Kovács Gy, Magyar F, Gyimóthy T: Static Slicing of JAVA Programs, Proceedings of SPLST'97, Fifth Symposium on Programming Languages and Software Tools, Jyväskylä, 7-9 June 1997, Finland, pp

CSCS June 2006 Difficult slicing problems Slicing arrays Precise slice requires distinquishing the elements of arrays (dependence analysis). Slicing pointers Two or more variables refer to the same memory location (aliasing problem).

CSCS June 2006 Dynamic Slicing Only one execution is taken into account. Korel&Laski proposed a data-flow approach to compute dynamic slices.(executable slices) Agrawal&Horgan developed an approach for using dependence graphs to compute non-executable slices.(size problem)

CSCS June 2006 Dynamic Dependence Graph

CSCS June 2006 Dynamic slicing  Forward global computation of dynamic slices Gyimóthy T, Beszédes Á, Forgács I: An Efficient Relevant Slicing Method for Debugging. In Proceedings of the Joint 7th European Software Engineering Conference and 7th ACM SIGSOFT International Symposium on the Foundations of Software Engineering (ESEC/FSE'99), Beszédes Á, Gergely T, Szabó ZsM, Csirik J, and Gyimóthy T: Dynamic Slicing Method for Maintenance of Large C Programs, In: Proceedings of the 5th European Conference on Software Maintenance and Reengineering (CSMR 2001), (Eds Sousa P, Ebert J), IEEE Computer Society, 2001, pp , Lisbon, Portugal, March 14-16, Certified as the best paper of the conference. Certified

CSCS June 2006 Relevant slicing 1. x=1 2. i=0 3. if i>0 then 4. x=2 5. z=x Gyimóthy T, Beszédes Á, Forgács I: An Efficient Relevant Slicing Method for Debugging. In Proceedings of the Joint 7th European Software Engineering Conference and 7th ACM SIGSOFT International Symposium on the Foundations of Software Engineering (ESEC/FSE'99)

CSCS June 2006 Union slices Union slice is the union of dynamic slices for a set of test cases. Á. Beszédes, Cs. Faragó, Zs. M. Szabó, J. Csirik and T. Gyimóthy. Union Slices for Program Maintenance. Proceedings of the International Conference on Software Maintenance (ICSM 2002), Montréal, Canada, October 3-6, 2002, IEEE Computer Society, 2002, pp ICSM 2002

CSCS June 2006 Union slices

CSCS June 2006 Applications Debugging Regression testing Software maintenance  Architecture reconstruction  Identify reusable functions  Reverse engineering  Slice metrics  Program comprehension

CSCS June 2006 Theory of program slicing David Binkley, Sebastian Danicic, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Bogdan Korel. A Formalisation of the Relationship between Forms of Program Slicing. Science of Computer Programming, Accepted for publication. David Binkley, Sebastian Danicic, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Bogdan Korel. Theoretical Foundations of Dynamic Program Slicing. Theoretical Computer Science, Accepted for publication. Dave Binkley, Sebastian Danicic, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Bogdan Korel. Minimal Slicing and the Relationships between Forms of Slicing. In Proceedings of the 5th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2005), pages 45-54, September 30 - October 1, Best paper award. Dave Binkley, Sebastian Danicic, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Lahcen Ouarbya. Formalizing Executable Dynamic and Forward Slicing. In Proceedings of the 4th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2004), pages 43-52, September 15-16, 2004.IEEE Computer Society, 2004.

CSCS June 2006 Background Informally:  A static slice preserves a projection of the semantics of the original program for all possible inputs.  A dynamic slice preserves the effect of the program for a fixed input. Thus, a static slice is expected to be a valid (even if an overly large) dynamic slice.

CSCS June 2006 Counter Example 1 x = 1; 2 x = 2; 3 if (x>1) 4 y = 1; 5 else 6 y = 1; 7 z = y; Original program 1 x = 1; 3 if (x>1) 4 y = 1; 5 else 6 y = 1; 7 z = y; A static slice w.r.t. ({ y },7)

CSCS June 2006 Counter Example

CSCS June 2006 Explanation The reason is in the details of the definitions. Static slicing, as defined by Weiser, does not care about the path of execution. Dynamic slicing of Korel & Laski requires the path to be same in the original program and in the slice.

CSCS June 2006 Motivation So, our „common knowledge” does not fit to the original definitions. We have to find out why? Thus, we provide a formal theory, which helps us to answer this question, i.e., which helps us to compare existing slicing techniques.

CSCS June 2006 The Program Projection Theory Syntactic ordering (≤)  A partial order on programs.  Describes a property slicing minimizes on. Semantic equivalence (≈)  An equivalence relation on programs.  Describes a property slicing keeps invariant. Projection ((≤,≈)) describes slicing.

CSCS June 2006 Syntactic Orderings Traditional sytanctic ordering (≤): a program q is smaller than p if it can be obtained by deleting statements from p. Other orderings are possible, e.g., amorphous slicing uses an ordering based only on the number of statements.

CSCS June 2006 Semantic Equivalences Can be defined by parameterizing a „unified equivalence relation”, U(S,V,P,X), which compares projections of state trajectories.  S: the set of initial states for which the trajectories have to be equal.  V: the set of variables of interest.  P: the set points of interest in the trajectory (line number and occurance of statement of interest).  X: a function on a pair of programs, determining which statements shall be kept in the trajectory (this captures the trajectory requirement of K&L).

CSCS June 2006 Instantiations of the Framework Parameterizations of a unified equivalence relation.  S(V,n) = U(Σ,V,{n}  N,ε)  D KLi (σ,V,n (k) ) = U({σ},V,{n (k) },  )

CSCS June 2006 Example T p =(1,{})(2,{ x=1 })(3,{ x=2 })(4,{ x=2 })(7,{ x=2, y=1 }) T q =(1,{})(3,{ x=1 })(6,{ x=1 })(7,{ x=1, y=1 })

CSCS June 2006 Example ∏ S (T p )=(7,{ y=1 }) ∏ S (T q )=(7,{ y=1 })

CSCS June 2006 Example ∏ D (T p )=(1,_)(3,_)(4,_)(7,{ y=1 }) ∏ D (T q )=(1,_)(3,_)(6,_)(7,{ y=1 })

CSCS June 2006 Comparison Once the formal descriptions of slicing techniques is available, they can be compared. Subsumes relation: A-slicing subsumes B-slicing iff all B-slices are valid A-slices as well.

CSCS June 2006 Subsumes Relation traditional static slicing dynamic slicing as defined by Korel and Laski

CSCS June 2006 Minimal Slices We moved on to investigate another relation between slicing techniques: which have smaller minimal slices than the others. Slice minimality is defined in terms of the syntactic ordering. Ranking slicing techniques: A-slicing is of lower (or equal) rank than B-slicing iff for all minimal B-slices there exists a smaller minimal (or equal) A-slice.

CSCS June 2006 Rank Relation dynamic slicing as defined by Korel and Laski traditional static slicing

CSCS June 2006 Example There is no minimal KL-dynamic slice, which is smaller than or equal to the second minimal static slice. 1 x = 1; 2 x = 2; 3 if (x>1) 4 y = 1; 5 else 6 y = 1; 7 z = y; The original program 4 y = 1; 7 z = y; A minimal static slice The minimal KL-dynamic slice 6 y = 1; 7 z = y; Another minimal static slice

CSCS June 2006 Relations We found (and proved) that rank is the dual concept of subsumes relationship. If a slicing subsumes another one then it is of lower rank. Subsumes relation Rank relation

CSCS June 2006 Summary of Results Static slicing and KL-dynamic slicing are incomparable in the subsumes relation (A static slice is not always a valid dynamic slice) Subsumes and rank are dual concepts Static slicing and KL-dynamic slicing are incomparable in the rank relation (It is not always possible to find a minimal KL- dynamic slice, which is smaller than, or equal to, a minimal static slice)

CSCS June 2006 Current Challenges There is no established common notation. How to deal with non-terminating programs? (Transfinite trajectories? Other solutions?) Which other slicing techniques can be formalized with this framework? What operations can we perform on sets of slices and what are their result? How do these results apply to schemas?