Sign up & Download
Sign in

Grammar-driven generation of domain-specific language testing tools

by Hui Wu
Innovation (2007)

Cite this document (BETA)

Available from citeseerx.ist.psu.edu
Page 1
hidden

Grammar-driven generation of domain-specific language testing tools

Grammar-Driven Generation of
Domain-Specific Language Testing Tools
Hui Wu
Department of Computer and Information Sciences, The University of Alabama at Birmingham
Birmingham, AL USA 35294-1170
wuh@cis.uab.edu

ABSTRACT
Domain-specific languages (DSLs) assist an end-user in writing a
software program using idioms that are closer to the abstractions
found in a specific problem domain. Language tool support for
DSLs is lacking when compared to the capabilities provided for
standard object-oriented general purpose languages (GPLs). For
example, support for debugging and testing a program written in a
DSL is often nonexistent. This poster abstract introduces an
investigation into a grammar-driven technique to build a
framework to generate DSL testing tools (e.g., debugger and test
engine). This research demonstrates the feasibility and
applicability of using information derived from DSL grammars
and existing software components to support end-user debugging
and testing in a domain friendly environment.
Categories and Subject Descriptors
D.3.1 [Programming Languages]: Formal Definitions and
Theory-Syntax, Semantics, D.2.5 [Software Engineering]:
Testing and Debugging-debugging aids, testing tools.
General Terms
Experimentation, Languages, and Verification.
Keywords
Debugging, domain-specific languages, testing, grammar.
1. INTRODUCTION
A DSL is a programming language or executable specification
language that offers, through appropriate notations and
abstractions, expressive power focused on, and usually restricted
to, a particular problem domain [1]. DSLs assist in the creation
of programs that are often more concise than an equivalent
program written in a traditional programming language. A key
benefit of using a DSL is the isolation of accidental complexities
typically required in the implementation phase such that an end-
user can focus on the key abstractions of the problem.
A common approach for implementing DSLs is to create a code
generator that translates the DSL source code into a GPL (e.g.,
Java and C++). A benefit of the generator approach is the
potential for reuse of the host GPL development infrastructure to
generate executable code. However, the translation has a serious
disadvantage when it comes to the issue of debugging and testing
because it requires knowledge of both the problem domain and
the target GPL. This results in a mismatch of abstraction levels
because the end-user must understand the translated code in the
GPL, rather than the higher-level description contained in the
DSL [2]. Thus, an end-user is not dealing with higher-level
domain concepts and notations, but instead in terms of GPL
concepts (e.g., error reporting, test case reporting, and debugging
are at the level of generated GPL code).
Ideally, a domain expert should be able to debug and test at the
DSL abstraction level rather than the translated GPL code. Such
an approach would preserve the primary benefit of using a DSL
by permitting debugging and testing using domain concepts.
Manual construction of the testing tools for each new DSL can be
time-consuming, expensive, and error-prone. An automated
approach to generate such tools from the DSL grammar
specification preserves all the advantages of using a DSL and
reduces the implementation costs of DSL tools. The mapping
information from the DSL to its generated GPL is a crucial
component of this research. To define the mapping, additional
semantic actions inside each grammar production are defined. A
crosscutting concern emerges from the addition of the explicit
mapping in each of the grammar productions. The manual
addition of the mapping code in each grammar production results
in much redundancy that can be better modularized using an
aspect-oriented approach applied to grammars [5].
2. RESEARCH OVERVIEW
An initial phase of the research was first performed to assess the
feasibility of the proposed approach toward generating debuggers
for DSLs (called the DSL Debugger Framework DDF). The
DDF is a set of Eclipse plug-ins providing core support for DSL
debugging. In the DDF, a language specification is written in
ANTLR (ANother Tool for Language Recognition), which is a
lexer and parser generator. A DSL is usually translated into a GPL
that can be compiled and executed. From a DSL grammar, the
DDF generates GPL code representing the intention of the DSL
program (i.e., the DSL is translated to a GPL and the GPL tools
are used to generate an executable program). The DDF also
generates the mapping information that integrates with the host
GPL debugger (e.g., the stand alone command line Java debugger
jdb). The generated mapping code re-interprets the DSL
program, and the debugger state, into a sequence of commands
that query the GPL debugger server. The responses from the GPL
debugger server are mapped back into the DSL debugger
perspective. Thus, the end user performs debugging actions at the
level of abstraction specified by the DSL, not at the lower-level
abstraction provided by the GPL. The construction of the
framework to generate a testing engine is similar to the process for
generating a debugger.

Copyright is held by the author/owner(s).
OOPSLA 05, October 16 20, 2005, San Diego, California, USA.
ACM 1-59593-193-7/05/0010.
210

Sign up today - FREE

Mendeley saves you time finding and organizing research. Learn more

  • All your research in one place
  • Add and import papers easily
  • Access it anywhere, anytime

Start using Mendeley in seconds!

Already have an account? Sign in

Readership Statistics

6 Readers on Mendeley
by Discipline
 
by Academic Status
 
67% Ph.D. Student
 
33% Student (Master)
by Country
 
17% Switzerland
 
17% Germany
 
17% Iran

Groups

pool