1 / 19

Program Slicing and Debugging

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. Program Slicing. What is it?

haamid
Download Presentation

Program Slicing and Debugging

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ProgramSlicing and Debugging Elton Alves Informatics Center Federal Universityof Pernambuco (UFPE) V EncontroBrasilieiro 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 SubjectProgram

  3. Program Slicing • What is it? • Program analysis technique to filter relevant lines of a subject program given a specific criteria SubjectProgram Consider that the assertion in this line is violated!

  4. Program Slicing • What is it? • Program analysis technique to filter relevant lines of a subject program given a specific criteria SubjectProgram That assertion depends on other lines!

  5. Program Slicing • What is it? • Program analysis technique to filter relevant lines of a subject program given a specific criteria SubjectProgram which depend on others…

  6. Program Slicing • What is it? • Program analysis technique to filter relevant lines of a subject program given a specific criteria SubjectProgram and so on…

  7. Program Slicing • What is it? • Program analysis technique to filter relevant lines of a subject program given a specific criteria SubjectProgram and so on…

  8. Program Slicing • What is it? • Program analysis technique to filter relevant lines of a subject program given a specific criteria Contains only relevant parts. SubjectProgram Sliced Program 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, PLDI’90

  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 coverage Box sizes denote relative size of slices relevant full = data + control data

  15. Different kinds: Precision and Cost coverage Increase chances of missing errors relevant full = data + control data

  16. Different kinds: Precision and Cost coverage Increase cost of computation relevant full = data + control data

  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 For more information visit: http://pan.cin.ufpe.br/

More Related