Download presentation
Presentation is loading. Please wait.
Published bySuzan Henderson Modified over 9 years ago
1
A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging
2
What is Algorithmic Debugging? Why should it be reformulated? Why should the reformulation be paradigm-independent and a generalization? A generalization of what?
3
int[ ] array = {1, 2, 3}; int sum = sumNumbers (array, "odd”); What should be the value of sum? A semi-automatic debugging technique (Java) Example: int add(int x, int y) {…} boolean isEven(int x) {…} int sumNumbers(int[] array, String eo) {…} 4
4
int[ ] array = {1, 2, 3}; int sum = sumNumbers (array, "odd”); What is the value of sum? A semi-automatic debugging technique (Java) (buggy) Example: int add(int x, int y) {…} boolean isEven(int x) {…} int sumNumbers(int[] array, String eo) {…} 3 Bug symptom
5
A semi-automatic debugging technique Algorithmic debugging session: Starting Debugging Session: (1) sumNumbers({1,2,3},"odd")=3? No (2) isEven(2)=true? Yes (3) isEven(3)=false? Yes (4) add(0,3)=3? Yes Bug found in method "sumNumbers". Internally…
6
Algorithmic debugging bug: Two problems identified in Algorithmic Debugging: (1) The information reported by an algorithmic debugger should be dynamic and not static. (2) The information reported by an algorithmic debugger should allow us to debug inside a method (thus reducing the granularity of Errors) Bug reported by standard algorithmic debuggers This is never executed: sum = add(sum, array[i]); The bug is inside the method: int i = 1;
7
MAIN CAUSE OF THE PROBLEMS: The Execution Tree Two problems identified in Algorithmic Debugging: (1) The information reported by an algorithmic debugger should be dynamic and not static. CAUSE: The execution tree does not record the trace of the execution (2) The information reported by an algorithmic debugger should allow us to debug inside a method (thus reducing the granularity of Errors) CAUSE: The nodes of the execution tree only represent method invocations
8
Paradigm independent Paradigm- and language-independent based on state transition systems Conservative generalization of the traditional formulation of AD many previous AD techniques are particular cases of this new formulation Modular The ET, strategies, transformations and properties are defined separately Reusable by other researchers Generalization Use dynamic information The output of an algorithmic debugger should contain dynamic information (i.e., it should not include non-executed code) Debug code inside methods Algorithmic debuggers should be able to ask questions about the code inside a method (and not only about the whole methods)
9
(1) Specialize the standard notion of execution tree: KEY IDEA: An Execution node is associated with the execution of any portion of code in the program. Depending on the concrete technique applied, different kinds of execution nodes can be used: Routine node: contains the execution of a method invocation Projection node: contains the execution of a set of method invocations Etc. Standard trees:
10
(2) Define a hierarchy of algorithmic debugging transformations: KEY IDEA: The hierarchy of transformation allows us to clearly state the time when transformations are applied, and their coordination. 1 1 21 1 2 1 1 21 1 2 1 2435 1 2435 b2b1
11
(3) Define a general algorithm for algorithmic debugging: KEY IDEA: Conceptually, the execution tree could be transformed after every answer. Code Code’ Answer Bug Source Code Transformation Execution Transformation Compiler ET Transformation
12
(4) Define properties for algorithmic debugging techniques:
13
Buggy Node Completeness Buggy Code CompletenessBuggy Code Reduction Bug Existence
14
Reformulation of algorithmic debugging Paradigm-independent Conservative generalization of the traditional formulation of AD Modular ET, strategies, transformations and properties are defined separately Taxonomy of techniques Based on the time Based on bug preservation properties Future (current) work Implementation Integrate traces into ET nodes Reduce ET nodes granularity
15
Thank you
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.