• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Object-Centric Debugging
 

Object-Centric Debugging

on

  • 1,541 views

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

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

Statistics

Views

Total Views
1,541
Views on SlideShare
1,030
Embed Views
511

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 511

http://scg.unibe.ch 510
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \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 Object-Centric Debugging Presentation Transcript

  • 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 used classes
  • Developer Questions
  • 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)
  • 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
  • Problem
  • { { { { } } } } { }
  • { { { { } } } } { }
  • 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)
  • 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 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: ...
  • 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 messageHalt on next overloaded messageHalt on object/s in callHalt on next message frompackage
  • 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.unibe.ch/research/bifrost/OCD