Debugging by lastChange

Developers often seek the origins of wrong values they see in their debugger. Their search must be backwards in time: the code causing the wrong value executed before the wrong value appeared. Searching with breakpoint- or log- based debuggers demands persistence and significant experience with the application being debugged. We introduce a new, practical feature for debuggers called \textit{lastChange}, which automatically locates the last point that a variable or an object property has been changed. Starting from a program halted on a breakpoint, the \textit{lastChange} solution applies queries to the live program during re-execution, recording the call stack and limited program state each time the property value changes. When the program halts again on the breakpoint, the recorded information can be shown to the developer. As a proof of this concept, we developed \textit{Querypoint}, a prototype which enhances the popular Firebug JavaScript debugger with the \textit{lastChange} feature and studied users applying the prototype to some test cases. The approach used in implementing \textit{lastChange} combines the flexibility of breakpoint debugging with the expressive power of log-based query debugging. Contrary to other replay-based approaches, which require exactly the same re-executions (deterministic executions), our new approach only requires \textit{bug reproducibility}, meaning a test case is available which reproduces the bug and a way to halt execution reliably after the reproduction.

[1]  Susan Horwitz,et al.  Better Debugging via Output Tracing and Callstack-Sensitive Slicing , 2010, IEEE Transactions on Software Engineering.

[2]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[3]  Thomas D. LaToza,et al.  Maintaining mental models: a study of developer work habits , 2006, ICSE.

[4]  Kazutaka Maruyama,et al.  Debugging with reverse watchpoint , 2003, Third International Conference on Quality Software, 2003. Proceedings..

[5]  Michael D. Bond,et al.  Tracking bad apples: reporting the origin of null and undefined value errors , 2007, OOPSLA.

[6]  Janusz W. Laski,et al.  Dynamic Program Slicing , 1988, Inf. Process. Lett..

[7]  Oscar Nierstrasz,et al.  Practical Object-Oriented Back-in-Time Debugging , 2008, ECOOP.

[8]  Brad A. Myers,et al.  Debugging reinvented , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[9]  Manu Sridharan,et al.  Thin slicing , 2007, PLDI '07.

[10]  Christoph K. Hofer,et al.  Implementing a backward - in - time debugger , 2006 .

[11]  Mireille Ducassé,et al.  Using events to debug Java programs backwards in time , 2003, OOPSLA '03.

[12]  Bob Boothe Efficient algorithms for bidirectional debugging , 2000, PLDI '00.

[13]  Andreas Zeller,et al.  Why Programs Fail: A Guide to Systematic Debugging , 2005 .

[14]  Sanjay Bhansali,et al.  Framework for instruction-level tracing and analysis of program executions , 2006, VEE '06.

[15]  John J. Barton,et al.  Dynamic and graphical web page breakpoints , 2010, WWW '10.

[16]  Éric Tanter,et al.  Processing , 1988 .