Formal Aspects of Computing

, Volume 28, Issue 2, pp 181–206 | Cite as

Formalizing and testing the consistency of DSL transformations

  • Sarmen KeshishzadehEmail author
  • Arjan J. Mooij
Open Access
Original Article


A domain specific language (DSL) focuses on the essential concepts in a specific problem domain, and abstracts from low-level implementation details. The development of DSLs usually centers around the meta-model, grammar and code generator, possibly extended with transformations to analysis models. Typically, little attention is given to the formal semantics of the language, whereas this is essential for reasoning about DSL models, and for assessing the correctness of the generated code and analysis models. We argue that the semantics of a DSL should be defined explicitly and independently of any code generator, to avoid all kinds of complexities from low-level implementation details. As the generated analysis models must reflect some of these implementation details, we propose to formalize them separately. To assess the correctness and consistency of the generated code and analysis models in a practical way, we use conformance testing. We extensively illustrate this general approach using specific formalizations for an industrial DSL on collision prevention. We do not aim for a generic semantic model for any DSL, but this specific DSL indicates the potential of a modular semantics to facilitate reuse among DSLs.


Domain specific language (DSL) Semantics Code generation Conformance testing 


  1. ABE11.
    Andova S, van den Brand MGJ, Engelen L (2011) Prototyping the semantics of a DSL using ASF+SDF: link to formal verification of DSL models. In: Proceedings of AMMSE’11, EPTCS, vol 56, pp 65–79Google Scholar
  2. ABE12.
    Andova S, van den Brand MGJ, Engelen L (2012) Reusable and correct endogenous model transformations. In: Proceedings of ICMT’12. LNCS, vol 7307. Springer, New York, pp 72–88Google Scholar
  3. AmO08.
    Ammann P, Offutt J (2008) Introduction to software testing. Cambridge University Press, CambridgeCrossRefzbMATHGoogle Scholar
  4. BaS82.
    Bazzichi F, Spadafora I (1982) An automatic generator for compiler testing. IEEE Trans Softw Eng 4: 343–353CrossRefzbMATHGoogle Scholar
  5. DeB08.
    De Moura L, Bjørner N (2008) Z3: an efficient SMT solver. In: Proceedings of TACAS’08. LNCS, vol 4963. Springer, New York, pp 337–340Google Scholar
  6. DMN+15.
    Dutle AM, Munoz CA, Narkawicz AJ, Butler RW (2015) Software validation via model animation. In: Proceedings of TAP’15. LNCS, vol 9154. Springer, New York, pp 92–108Google Scholar
  7. EhE08.
    Ehrig H, Ermel C (2008) Semantical correctness and completeness of model transformations using graph and rule transformation. In: Proceedings of ICGT’08. LNCS, vol 5214. Springer, New York, pp 194–210Google Scholar
  8. FMO+10.
    Fiorentini C, Momigliano A, Ornaghi M, Poernomo I (2010) A constructive approach to testing model transformations. In: Proceedings of ICMT’10. LNCS, vol 6142. Springer, New York, pp 77–92Google Scholar
  9. Gau95.
    Gaudel MC (1995) Testing can be formal, too. In: Proceedings of TAPSOFT’95. LNCS, vol 915. Springer, New York, pp 82–96Google Scholar
  10. KMM13.
    Keshishzadeh S, Mooij AJ, Mousavi M (2013) Early fault detection in DSLs using smt solving and automated debugging. In: Proceedings of SEFM’13. LNCS, vol 8137, pp 182–196Google Scholar
  11. KeM14.
    Keshishzadeh S, Mooij AJ (2014) Formalizing DSL semantics for reasoning and conformance testing. In: Proceedings of SEFM’14. Springer, New York, pp 81–95Google Scholar
  12. Ler09.
    Leroy X (2009) Formal verification of a realistic compiler. Commun ACM 52(7): 107–115CrossRefGoogle Scholar
  13. Math.
    Wolfram Research Inc., Mathematica Accessed Aug 2015
  14. MHA13.
    Mooij AJ, Hooman J, Albers R (2013) Gaining industrial confidence for the introduction of domain-specific languages. In: Proceedings of IEESD’13. IEEE, pp 662–667Google Scholar
  15. MHA14.
    Mooij AJ, Hooman J, Albers R (2014) Early fault detection using design models for collision prevention in medical equipment. In: Proceedings of FHIES’13. LNCS, vol 8315. Springer, New York, pp 170–187Google Scholar
  16. MHD+15.
    Moreira AM, Hentz C, Déharbe D, de Matos ECB, Neto JBS, de Medeiros Jr V (2015) Verifying code generation tools for the B-method using tests: a case study. In: Proceedings of TAP’15. LNCS, vol 9154. Springer, New York, pp 76–91Google Scholar
  17. MHS05.
    Mernik M, Heering J, Sloane AM (2005) When and how to develop domain-specific languages. Comput Surv ACM 37: 316–344CrossRefGoogle Scholar
  18. NCB+12.
    Nagy I, Cleophas LG, van den Brand M, Engelen L, Raulea L, Mithun EXL (2012) VPDSL: a DSL for software in the loop simulations covering material flow. In: Proceedings of ICECCS’12. IEEE, pp 318–327Google Scholar
  19. RVM+12.
    Ratiu D, Voelter M, Molotnikov Z, Schaetz B (2012) Implementing modular domain specific languages and analyses. In: Proceedings of workshop on MoDeVVa’12. ACM, New York, pp 35–40Google Scholar
  20. RDV09.
    Rivera JE, Durán F, Vallecillo A (2009) Formal specification and analysis of domain specific models using maude, simulation: transactions of the society for modeling and simulation international. Sage Publications, USA, pp 778–792Google Scholar
  21. SaW08.
    Sadilek DA, Wachsmuth G (2008) Prototyping visual interpreters and debuggers for domain-specific modelling languages. In: Proceedings of ECMDA-FA’08. LNCS, vol 5095. Springer, New York, pp 63–78Google Scholar
  22. SBP+08.
    Steinberg D, Budinsky F, Paternostro M, Merks E (2008) Eclipse modeling framework. Pearson Education, LondonGoogle Scholar
  23. SWR+12.
    Stappers FPM, Weber S, Reniers MA, Andova S, Nagy I (2012) Formalizing a domain specific language using sos: an industrial case study. In: Proceedings of SLE’11. LNCS, vol 6940. Springer, New York, pp 223–242Google Scholar
  24. TFG+07.
    Theelen BD, Florescu O, Geilen MCW, Huang J, van der Putten PHA, Voeten JPM (2007) Software/hardware engineering with the parallel object-oriented specification language. In: Proceedings of the international conference on formal methods and models for codesign. IEEE, pp 139–148Google Scholar
  25. Tre08.
    Tretmans J (2008) Model based testing with labelled transition systems. In: (eds) Formal methods and testing. LNCS, vol 4949. Springer, New York, pp 1–38Google Scholar
  26. BrG13.
    van den Brand M, Groote JF (2013) Software engineering: redundancy is key. Sci Comput Program Elsevier 97: 75–81CrossRefGoogle Scholar
  27. BRM+13.
    van den Berg F, Remke A, Mooij AJ, Haverkort B (2013) Performance evaluation for collision prevention based on a domain specific language. In: Proceedings of EPEW’13, vol 8168. Springer, New York, pp 276–287Google Scholar
  28. DKV00.
    van Deursen A, Klint P, Visser J (2000) Domain-specific languages: an annotated bibliography. In: (eds) SIGPLAN notices, vol 35. ACM, New York, pp 26–36Google Scholar
  29. VLH+13.
    Verriet J, Liang HL, Hamberg R, van Wijngaarden B (2013) Model-driven development of logistic systems using domain-specific tooling. In: Proceedings of CSD&M. Springer, New York, pp 165–176Google Scholar
  30. Voe13.
    Voelter M (2013) DSL engineering, version 1.0. Accessed Aug 2015
  31. Xte14.
    Xtext (2014) Version 2.7. Accessed Aug 2015

Copyright information

© The Author(s) 2016

Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Authors and Affiliations

  1. 1.Department of Computer ScienceEindhoven University of TechnologyEindhovenThe Netherlands
  2. 2.Embedded Systems Innovation by TNOEindhovenThe Netherlands

Personalised recommendations