This dissertation brings together the computer science fields language engineering,
modelbased development, and test-driven development with the objective to improve the development of
domain-specific languages (DSLs). DSLs are computer languages that are tailored to a specific
application domain, i.e., they use domain-specific concepts and a domain-specificnotation.
Their purpose is to develop high-quality software in a cost-effective manner.
A DSL can be used by a programmer instead of or in addition to a general-purpose programming
language. It can even be used by a non-programmer if he is a domain expert who
understands the DSL’s domain-specific concepts. DSLs are developed by language engineers,
who need tools and a methodology for this. In this dissertation, we are concerned with
DSLs whose concepts are not clear from thebeginning. Such DSLs must be developed iteratively:
• Domain expert and language engineer discuss some example uses of the language
and create an informal language sketch.
• The language engineer implements a prototype, which consists of tools for the DSL,
e.g., an editor and an interpreter.
• Domain expert and language engineer use the prototype to experiment with the current
DSL version. They may identify necessary changes, which will be incorporated
in the next iteration.
Because developing a DSL can only pay off if the development costs less than what can
be saved by using the DSL, it is this dissertation’s objective to enable a cost-effective development
of DSLs. To this end, we invent technologies that allow language engineers to develop
DSLs with a model-based and test-driven methodology. In model-based language engineering,
the language engineer does not implement tools for a DSL manually. Instead, he describes
certain aspects of the DSL with models from which tools can be derived automatically. The
idea of test-driven development is to create tests for new program code before the code itself
is written (test-first). This methodology is established for increasing programmer productivity
and code quality. The hypothesis of this dissertation is that test-driven development
can be applied not only to programming of code but also to model-based development of
DSLs.
We take existing practices in model-based DSL development as a starting point:
• the abstract syntax of a DSL is described with a metamodel;
• its semantics is described as metamodel-based operational semantics, i.e., the metamodel
is extended to allow for modeling runtime states, and a model-to-model
transformation is created that transforms a runtime state to its succeeding state.
n this basis, this dissertation contributes the following:
• an approach for testing metamodels,
• regarding coverage criteria for metamodel tests
• an approach for modeling and executing coverage criteria and
• ?ve exemplary coverage criteria,
• regarding metamodel-based description of operational semantics
• an approach that allows a language engineer to ?exibly choose the description lan- guage,
• approaches for animated execution of DSLs, for modeling of debuggers, and for
stepping back in the execution history of DSL programs,
• approaches for testing operational semantics descriptions, speci?cally for
• testing the simulation relation between di?erent semantics descriptions,
• regression testing against recorded execution traces, and
• test-?rst testing against execution traces pre-de?ned by a language engineer.
Furthermore, we provide tool implementations of all these approaches and an industrial case tudy
that demonstrates the feasibility of the approaches and the usability of the imple- ented tools.
With the approaches we develop in this dissertation, the aforementioned iterative DSL evelopment
process can be extended with a model-based and test-driven methodology: The anguage engineer does
not directly implement the informal language sketch in a prototype nymore. Instead, he creates
formal, automatically executable tests of the DSL’s abstract yntax and operational semantics
(test-driven methodology). After this, he creates models
f the abstract syntax and operational semantics, tests them, and derives from them an
nterpreter automatically (model-based methodology).
Daniel Sadilek
Language engineering model-based development modeling test-driven development