a generalization and paradigm-independent reformulation of algorithmic debugging

15
A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Upload: suzan-henderson

Post on 02-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

A Generalization and Paradigm-IndependentReformulation of Algorithmic Debugging

Page 2: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

What is Algorithmic Debugging?

Why should it be reformulated?

Why should the reformulation be paradigm-independent and a generalization?

A generalization of what?

Page 3: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

int[ ] array = {1, 2, 3};int sum = sumNumbers (array , "odd”);

What should be the value of sum?

A semi-automatic debugging technique

What is Algorithmic Debugging?

(Java) Example:

int add(int x, int y) {…}

boolean isEven(int x) {…}

int sumNumbers(int[] array, String eo) {…}

4

Page 4: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

int[ ] array = {1, 2, 3};int sum = sumNumbers (array , "odd”);

What is the value of sum?

A semi-automatic debugging technique

What is Algorithmic Debugging?

(Java) (buggy) Example:

int add(int x, int y) {…}

boolean isEven(int x) {…}

int sumNumbers(int[] array, String eo) {…}

3Bug symptom

Page 5: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

A semi-automatic debugging technique

What is Algorithmic Debugging?

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…

Page 6: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Why should AD be reformulated?

Algorithmic debugging bug:

Two problems identified in Algorithmic Debugging:

(1) The information reported by an algorithmicdebugger should be dynamic and not static.

(2) The information reported by an algorithmicdebugger should allow us to debug insidea method (thus reducing the granularity ofErrors)

Bug reported by standard algorithmic debuggers

This is never executed:sum = add(sum, array[i]);

The bug is inside the method:int i = 1;

Page 7: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Why should AD be reformulated?

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

Page 8: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Reformulation of Algorithmic DebuggingParadigm 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)

Page 9: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Reformulation of Algorithmic Debugging

(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 invocationProjection node: contains the execution of a set of method invocationsEtc.

Standard trees:

Page 10: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Reformulation of Algorithmic Debugging

(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

2 43 5

1

2 43 5

b2b1

Page 11: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Reformulation of Algorithmic Debugging

(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 TransformationExecution Transformation

Compiler

ET Transformation

Page 12: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Reformulation of Algorithmic Debugging

(4) Define properties for algorithmic debugging techniques:

Page 13: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Reformulation of Algorithmic Debugging

(4) Define properties for algorithmic debugging techniques:

Buggy Node Completeness

Buggy Code CompletenessBuggy Code Reduction

Page 14: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Conclusions

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

Page 15: A Generalization and Paradigm-Independent Reformulation of Algorithmic Debugging

Thank you