Download presentation
Presentation is loading. Please wait.
Published byEliezer Standridge Modified over 10 years ago
1
Program Slicing and Debugging Elton Alves Informatics Center Federal University of Pernambuco (UFPE) V Encontro Brasilieiro de Testes de Software (EBTS), Recife-PE, Brazil, April 2011
2
Program Slicing What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria Subject Program
3
Program Slicing Consider that the assertion in this line is violated! Subject Program What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria
4
Program Slicing Subject Program That assertion depends on other lines! What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria
5
Program Slicing Subject Program which depend on others… What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria
6
Program Slicing Subject Program and so on… What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria
7
Program Slicing Subject Program and so on… What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria
8
Program Slicing Subject Program Sliced Program What is it? – Program analysis technique to filter relevant lines of a subject program given a specific criteria Contains only relevant parts. Should focus on that for debugging!
9
Considerations Very different from coverage – In the example, not all covered lines are in the slice Not only for debugging – Test generation – Model extraction It works for arbitrarily complex programs
10
Quick note on dependency Control dependency (a => b) – Execution at a depends on control decision at b Data dependency (a => b) – Use of variable x at a depends on definition of x at b
11
Illustration: Control and Data Dependency PROGRAM DEPENDENCE GRAPH (PDG) From Dynamic Program Slicing, Agrawal and Horgan, PLDI90
12
Slicers Input Static slicers (slice at compile time) – Input: slicing criteria and program Dynamic slicers (slice at execution time) – Input: slicing criteria, program, and test case
13
Static and Dynamic slicers Static slices tend to grow very rapidly – Problems: Pointer aliasing and dynamic binding Dynamic slices are incomplete but more precise: they operate with one test case. We focus on dynamic slicing.
14
Different kinds: Precision and Cost full = data + control data coverage relevant Box sizes denote relative size of slices
15
Different kinds: Precision and Cost full = data + control data coverage relevant Increase chances of missing errors
16
Different kinds: Precision and Cost full = data + control data coverage relevant Increase cost of computation
17
Important findings [Zhang et al., AADEBUG 2005] Only relevant slicer is complete Relevant and full require static analysis info Data slices are remarkably smaller than other kinds of slices but very often miss errors Relevant and full have almost same size and capability of finding errors
18
Existing Implementations Several implementation in C For Java – JSlicer (http://jslice.sourceforge.net) Backward slicer that runs with JDK 1.4 – Extension to Java PathFinder – Under development in our group
19
Our group work Improve precision of lightweight debugging – We use dynamic slicing and evolution information Check conformance of feature models (FM) – FMs are used in software product line development – We use dynamic slicing to extract FMs from code http://pan.cin.ufpe.br/For more information visit:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.