Cutting Java Expressions into Lines for Detecting their Evaluation at Runtime

Practical Java Debuggers can evaluate expressions at specified break points. Such evaluations may cause extra side effects and make an execution at debugging different from the original one. As a result, Java developers often have to edit the original source code in order to safely examine runtime values of expressions. In order to cope with this problem, we aim at developing a new feature for a debugger to detect evaluations of an expression by a Java virtual machine. This debugging feature doesn't introduce any extra side effects, and will enable Java programmers to examine runtime values of an expression by simply specifying it. The implementation of the above feature requires a debugger to make correspondence between bytecode instructions executed by a Java Virtual Machine and expressions in Java source texts. As the first step toward our goal, we have developed a source code translation method to make this correspondence using LineNumberTable attributes in class files generated by a standard Java compiler. There are still several cases that this method fails to automatically determine appropriate correspondence between bytecode instructions and expressions, but its solution has been left as future work. In this paper, we introduce a formalization to this method as a basis of our rigid analysis of failure cases. We evaluate our analysis method by conducting an experimental task to find failure patterns whose template is defined by our formalization.

[1]  Brad A. Myers,et al.  Asking and answering questions about the causes of software behavior , 2008 .

[2]  Jonathan B. Rosenberg How Debuggers Work: Algorithms, Data Structures, and Architecture , 1996 .

[3]  Yasuhiro Takemura,et al.  Identifying Mandatory Code for Framework Use via a Single Application Trace , 2014, ECOOP.

[4]  Stéphane Ducasse,et al.  Taking an object-centric view on dynamic information with object flow analysis , 2009, Comput. Lang. Syst. Struct..

[5]  Andreas Zeller Chapter 6 – Scientific Debugging , 2006 .

[6]  Mark Harman,et al.  ORBS and the limits of static slicing , 2015, 2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM).

[7]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[8]  Brad A. Myers,et al.  Extracting and answering why and why not questions about Java program output , 2010, TSEM.

[9]  Andreas Zeller,et al.  Why Programs Fail, Second Edition: A Guide to Systematic Debugging , 2009 .

[10]  Oscar Nierstrasz,et al.  Object-centric debugging , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[11]  James Gosling,et al.  The Java Language Specification, 3rd Edition , 2005 .

[12]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[13]  Adrian Lienhard,et al.  Dynamic Object Flow Analysis , 2009, it Inf. Technol..

[14]  Shing-Chi Cheung,et al.  Taming coincidental correctness: Coverage refinement with context patterns to improve fault localization , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[15]  Izuru Kume,et al.  Revealing Implicit Correspondence between Bytecode Instructions and Expressions Determined by Java Compilers , 2018, 2018 25th Australasian Software Engineering Conference (ASWEC).