Object-Centric  DebuggingJorge Ressia, Alexandre Bergel     and Oscar Nierstrasz
Debugging:Is the process of interacting with arunning software system to test andunderstand its current behavior.
TraditionalDebuggers
Mondrian
C omp lexity  stemand Ducasse 2003Sy zaLan
Rendering
Shape and Nodes
How do we debug     this?
Breakpoints
ConditionalBreakpoints
Defined separatelyon the source code
The debugger hasno object-specific   operations
InstructionStream
pc
How do we debug     this?
Debugging through operations  18 step in for first modification30 operations for next modification
Setting breakpoints      31 method accessing the variable                9 assignmentspc setter is used by 5 intensively u...
Developer Questions
When during the execution is this method called? (Q.13)  Where are instances of this class created? (Q.14)  Where is this ...
When during the execution is this method called? (Q.13)  Where are instances of this class created? (Q.14)  Where is this ...
Problem
{               {    {                   {                            }        }        }            }       {       }
{               {    {                   {                            }        }        }            }       {       }
Which is the relationship?When during the execution is this method called? (Q.13)                                         ...
ObjectsSource    Traditional Code     Debuggers
Object-CentricObjects           DebuggersSource     Traditional Code      Debuggers
Object-Centric Debugging
{               {    {                   {                            }        }        }            }       {       }
{               {    {                   {                            }        }        }            }       {       }
{               {    {                   {                            }        }        }            }       {       }
What does it  mean?
interceptingaccess to object- specific runtime       state
monitoringobject-specific interactions
supporting live  interaction
InstructionStream
halt on next  change
stack-centric debugging                   InstructionStream class>>on:                   InstructionStream class>>new     ...
Mondrian
Shape and Nodes
halt on object in       call
Halt on next messageHalt on next message/s namedHalt on state changeHalt on state change namedHalt on next inherited messa...
Issue
we need to redefine the debugger UI
Implementation
Adaptation
Reflection
scg.unibe.ch/research/bifrost
Object-Centric Reflection
Organize the Meta-level
ExplicitMeta-objects
Class          Meta-object Object
Class          Meta-object Object
Class            Meta-objectAdapted Object
Object-Centric    Objects                     Debuggers    Source           Traditional     Code            Debuggersscg.u...
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Object-Centric Debugging
Upcoming SlideShare
Loading in...5
×

Object-Centric Debugging

1,567

Published on

Presentation of the paper "Object-Centric Debugging" at ICSE2012

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,567
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • is a framework for drawing graphs\n
  • width = the number of attributes of the class\nheight = the number of methods of the class\ncolor = the number of lines of code of the class\n\n
  • \n
  • double dispatch\n
  • one of the nodes was not correctly rendered\n
  • \n
  • \n
  • \n
  • Why do I need to write code?\nWhy do I need to know about object id?\nI want to grab the object, it is there\n
  • Why do I need to write code?\nWhy do I need to know about object id?\nI want to grab the object, it is there\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Which questions do these debuggers try to answer?\n
  • Sillito\n
  • Which questions do these debuggers try to answer?\n
  • We have to go back to the code\n
  • \n
  • new dimension of problem-domain\n
  • new dimension of problem-domain\n
  • Which questions do these debuggers try to answer?\n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • \n
  • Questions 15, 19, 20, 28 and 33 all have to do with tracking state at runtime. Consider in particular question 15: Where is this variable or data structure being accessed? Let us assume that we want to know where an instance variable of an object is being modified. This is known as keeping track of side-effects [3]. One approach is to use step-wise operations until we reach the modification. However, this can be time-consuming and unreliable. Another approach is to place breakpoints in all assignments related to the instance variable in question. Finding all these assignments might be troublesome depending on the size of the use case, as witnessed by our own experience.\nTracking down the source of this side effect is highly challenging: 31 of the 38 methods defined on InstructionStream access the variable, comprising 12 assignments; the instance variable is written 9 times in InstructionStream’s subclasses. In addition, the variable pc has an accessor that is referenced by 5 intensively-used classes.\n\n
  • Question 22 poses further difficulties for the debugging approach: How are these types or objects related? In statically typed languages this question can be partially answered by finding all the references to a particular type in another type. Due to polymorphism, however, this may still yield many false positives. (An instance variable of type Object could be potentially bound to instances of any type we are interested in.) Only by examining the runtime behavior can we learn precisely which types are instantiated and bound to which variables. The debugging approach would, however, require heavy use of conditional breakpoints (to filter out types that are not of interest), and might again entail the setting of breakpoints in a large number of call sites.\n\n
  • Back-in-time debugging [4], [5] can potentially be used to answer many of these questions, since it works by maintain- ing a complete execution history of a program run. There are two critical drawbacks, however, which limit the practical application of back-in-time debugging. First, the approach is inherently post mortem. One cannot debug a running system, but only the history of completed run. Interaction is therefore strictly limited, and extensive exploration may require many runs to be performed. Second, the approach entails considerable overhead both in terms of runtime performance and in terms of memory requirements to build and explore the history.\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • double dispatch\n
  • one of the nodes was not correctly rendered\n
  • We have more commands that the ones in the debugger, but we did not know how to put them there.\n
  • one of the nodes was not correctly rendered\n
  • halt on next specific messages\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • We see that there are many different ways of doing reflection, adaptation, instrumentation, many are low level.\nAnd the ones that are highly flexible cannot break free from the limitations of the language.\n
  • Adaptation semantic abstraction for composing meta-level structure and behavior.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Object-Centric Debugging

    1. 1. Object-Centric DebuggingJorge Ressia, Alexandre Bergel and Oscar Nierstrasz
    2. 2. Debugging:Is the process of interacting with arunning software system to test andunderstand its current behavior.
    3. 3. TraditionalDebuggers
    4. 4. Mondrian
    5. 5. C omp lexity stemand Ducasse 2003Sy zaLan
    6. 6. Rendering
    7. 7. Shape and Nodes
    8. 8. How do we debug this?
    9. 9. Breakpoints
    10. 10. ConditionalBreakpoints
    11. 11. Defined separatelyon the source code
    12. 12. The debugger hasno object-specific operations
    13. 13. InstructionStream
    14. 14. pc
    15. 15. How do we debug this?
    16. 16. Debugging through operations 18 step in for first modification30 operations for next modification
    17. 17. Setting breakpoints 31 method accessing the variable 9 assignmentspc setter is used by 5 intensively used classes
    18. 18. Developer Questions
    19. 19. When during the execution is this method called? (Q.13) Where are instances of this class created? (Q.14) Where is this variable or data structure being accessed? (Q.15) What are the values of the argument at runtime? (Q.19) What data is being modified in this code? (Q.20) How are these types or objects related? (Q.22) How can data be passed to (or accessed at) this pointin the code? (Q.28) What parts of this data structure are accessed in thiscode? (Q.33)
    20. 20. When during the execution is this method called? (Q.13) Where are instances of this class created? (Q.14) Where is this variable or data structure being accessed? (Q.15) What are the values of the argument at runtime? (Q.19) What data is being modified in this code? (Q.20) How are these types or objects related? (Q.22) How can data be passed to (or accessed at) this pointin the code? (Q.28) What parts of this data structure are accessed in thiscode? (Q.33) llito Si etal. g softwar e ask durin gr ammers s. 2008 Questi ons pro ution task evol
    21. 21. Problem
    22. 22. { { { { } } } } { }
    23. 23. { { { { } } } } { }
    24. 24. Which is the relationship?When during the execution is this method called? (Q.13) ?Where are instances of this class created? (Q.14)Where is this variable or data structure being accessed? (Q.15)What are the values of the argument at runtime? (Q.19)What data is being modified in this code? (Q.20)How are these types or objects related? (Q.22)How can data be passed to (or accessed at) this point in the code? (Q.28)What parts of this data structure are accessed in this code? (Q.33)
    25. 25. ObjectsSource Traditional Code Debuggers
    26. 26. Object-CentricObjects DebuggersSource Traditional Code Debuggers
    27. 27. Object-Centric Debugging
    28. 28. { { { { } } } } { }
    29. 29. { { { { } } } } { }
    30. 30. { { { { } } } } { }
    31. 31. What does it mean?
    32. 32. interceptingaccess to object- specific runtime state
    33. 33. monitoringobject-specific interactions
    34. 34. supporting live interaction
    35. 35. InstructionStream
    36. 36. halt on next change
    37. 37. stack-centric debugging InstructionStream class>>on: InstructionStream class>>new InstructionStream>>initialize step into, CompiledMethod>>initialPC step over, InstructionStream>>method:pc: resume InstructionStream>>nextInstruction MessageCatcher class>>new InstructionStream>>interpretNextInstructionFor: ... object-centric debugging centered on centered onthe InstructionStream class the InstructionStream object initialize on:next message, next message, method:pc: new next change nextInstruction ... next change interpretNextInstructionFor: ...
    38. 38. Mondrian
    39. 39. Shape and Nodes
    40. 40. halt on object in call
    41. 41. Halt on next messageHalt on next message/s namedHalt on state changeHalt on state change namedHalt on next inherited messageHalt on next overloaded messageHalt on object/s in callHalt on next message frompackage
    42. 42. Issue
    43. 43. we need to redefine the debugger UI
    44. 44. Implementation
    45. 45. Adaptation
    46. 46. Reflection
    47. 47. scg.unibe.ch/research/bifrost
    48. 48. Object-Centric Reflection
    49. 49. Organize the Meta-level
    50. 50. ExplicitMeta-objects
    51. 51. Class Meta-object Object
    52. 52. Class Meta-object Object
    53. 53. Class Meta-objectAdapted Object
    54. 54. Object-Centric Objects Debuggers Source Traditional Code Debuggersscg.unibe.ch/research/bifrost/OCD

    ×