Skip to main content
QUICK REVIEW

[Paper Review] Systematic Debugging of Attribute Grammars

Yohei Ikezoe, Akira Sasaki|ArXiv.org|Nov 21, 2000
Software Testing and Debugging TechniquesComputer Science10 references4 citations
TL;DR

This paper proposes two AG-aware debugging techniques—algorithmic debugging and slice-based debugging—for attribute grammars, enabling developers to systematically locate faulty attribution rules through interactive query-based refinement. Integrated into the visual debugger Aki, the approach reduces debugging time significantly compared to conventional methods, with experiments showing a 5x to 10x speedup in bug localization for compiler modules.

ABSTRACT

Although attribute grammars are commonly used for compiler construction, little investigation has been conducted on debugging attribute grammars. The paper proposes two types of systematic debugging methods, an algorithmic debugging and slice-based debugging, both tailored for attribute grammars. By means of query-based interaction with the developer, our debugging methods effectively narrow the potential bug space in the attribute grammar description and eventually identify the incorrect attribution rule. We have incorporated this technology in our visual debugging tool called Aki.

Motivation & Objective

  • To address the lack of systematic debugging support for attribute grammars in compiler construction.
  • To reduce the cognitive burden on developers by abstracting away low-level implementation details of attribute evaluators.
  • To provide a high-level, interactive debugging environment that isolates faulty attribution rules efficiently.
  • To evaluate the effectiveness of hybrid debugging techniques in real compiler development workflows.

Proposed method

  • Adapt algorithmic debugging to attribute grammars by modeling attribute evaluation as recursive Synth function applications.
  • Use query-based interaction to validate or refute the correctness of attribute computations and narrow down erroneous rules.
  • Apply slice-based debugging to trace attribute dependencies backward from incorrect values to identify faulty rules.
  • Partition attribute slices into sub-slices and query developers about correctness to iteratively reduce the search space.
  • Implement the system in Squeak Smalltalk as a visual debugger (Aki) with source code visualization and color-highlighted attribute operations.
  • Integrate both debugging techniques into a unified environment that supports both complete and partial program executions.

Experimental results

Research questions

  • RQ1How can algorithmic debugging be effectively adapted to the attribute grammar paradigm, where evaluation is inherently recursive and attribute-dependent?
  • RQ2Can slice-based debugging be applied to attribute grammars to locate bugs in incomplete or non-terminating executions?
  • RQ3How does the combination of algorithmic and slice-based debugging improve developer efficiency in locating faulty attribution rules?
  • RQ4To what extent does the Aki debugger reduce debugging time compared to manual or conventional debugging approaches?

Key findings

  • The algorithmic debugging component of Aki reduced average time to locate a bug to 3 minutes, compared to 15 minutes without any debugging support.
  • The slice-based debugging component required an average of 13 queries to locate a bug, compared to 9 for algorithmic debugging, indicating slightly higher interaction cost but broader applicability.
  • User testing with three experienced compiler developers showed that both systematic debugging methods significantly outperformed manual debugging in terms of time and effort.
  • The visual debugger Aki effectively supports understanding of complex attribute dependencies through source code highlighting and subtree visualization.
  • The system successfully located a deliberate bug in a rule involving incorrect attribute propagation in a binary number evaluation grammar.
  • The hybrid approach enables debugging of programs that fail mid-execution, where traditional algorithmic debugging cannot construct a full computation tree.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.