Validation of Transformation from Abstract State Machine Models to C++ Code

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11146)


The automatic transformation of models to code is one of the most important cornerstones in the model-driven engineering paradigm. Starting from system models, users are able to automatically generate machine code in a seamless manner with an assurance of potential bug freeness of the generated code. Asm2C++ [4] is the tool that transforms Abstract State Machine models to Open image in new window code. However, no validation activities have been performed in the past to guarantee the correctness of the transformation process. In this paper, we define a mechanism to test the correctness of the model-to-code transformation with respect to two main criteria: syntactical correctness and semantic correctness, which is based on the definition of conformance between the specification and the code. Using this approach, we have devised a process able to test the generated code by reusing unit tests. Coverage measures give a user the confidence that the generated code has the same behavior as specified by the ASM model.


Abstract State Machines (ASM) ASM Model Internal Nondeterminism ASM Specifications Asmeta 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Rahim, L.A., Whittle, J.: A survey of approaches for verifying model transformations. Softw. Syst. Model. 14(2), 1003–1028 (2015)CrossRefGoogle Scholar
  2. 2.
    Arcaini, P., Gargantini, A., Riccobene, E., Scandurra, P.: A model-driven process for engineering a toolset for a formal method. Softw.: Pract. Exp. 41, 155–166 (2011)Google Scholar
  3. 3.
    Baudry, B., Ghosh, S., Fleurey, F., France, R., Le Traon, Y., Mottu, J.M.: Barriers to systematic model transformation testing. Commun. ACM 53(6), 139–143 (2010)CrossRefGoogle Scholar
  4. 4.
    Bonfanti, S., Carissoni, M., Gargantini, A., Mashkoor, A.: Asm2C++: a tool for code generation from abstract state machines to Arduino. In: Barrett, C., Davies, M., Kahsai, T. (eds.) NFM 2017. LNCS, vol. 10227, pp. 295–301. Springer, Cham (2017). Scholar
  5. 5.
    Bonfanti, S., Gargantini, A., Mashkoor, A.: Generation of C++ unit tests from abstract state machines specifications. In: 14th Workshop on Advances in Model Based Testing (A-MOST 2018) @ICST 2018, Västerås, Sweden (2018)Google Scholar
  6. 6.
    Börger, E., Stark, R.F.: Abstract State Machines: A Method for High-Level System Design and Analysis. Springer, Heidelberg (2003). Scholar
  7. 7.
    Calegari, D., Szasz, N.: Verification of model transformations: a survey of the state-of-the-art. Electron. Notes Theor. Comput. Sci. 292, 5–25 (2013). Proceedings of the XXXVIII Latin American Conference in Informatics (CLEI)CrossRefGoogle Scholar
  8. 8.
    Conrad, M.: Testing-based translation validation of generated code in the context of IEC 61508. Form. Methods Syst. Des. 35(3), 389–401 (2009)CrossRefGoogle Scholar
  9. 9.
    France, R., Rumpe, B.: Model-driven development of complex software: a research roadmap. In: 2007 Future of Software Engineering, FOSE 2007, pp. 37–54. IEEE Computer Society, Washington, DC, USA (2007)Google Scholar
  10. 10.
    Küster, J.M., Abd-El-Razik, M.: Validation of model transformations – first experiences using a white box approach. In: Kühne, T. (ed.) MODELS 2006. LNCS, vol. 4364, pp. 193–204. Springer, Heidelberg (2007). Scholar
  11. 11.
    Sampath, P., Rajeev, A.C., Ramesh, S.: Translation validation for stateflow to C. In: 2014 51st ACM/EDAC/IEEE Design Automation Conference (DAC), pp. 1–6, June 2014Google Scholar
  12. 12.
    Schmidt, D.C.: Model-driven engineering. IEEE Comput. 39(2), 25–31 (2006)CrossRefGoogle Scholar
  13. 13.
    Stuermer, I., Conrad, M., Doerr, H., Pepper, P.: Systematic testing of model-based code generators. IEEE Trans. Softw. Eng. 33(9), 622–634 (2007)CrossRefGoogle Scholar
  14. 14.
    Tillmann, N., de Halleux, J.: Pex–white box test generation for \(\text{.NET }\). In: Beckert, B., Hähnle, R. (eds.) TAP 2008. LNCS, vol. 4966, pp. 134–153. Springer, Heidelberg (2008). Scholar
  15. 15.
    Van Der Straeten, R., Mens, T., Van Baelen, S.: Challenges in model-driven software engineering. In: Chaudron, M.R.V. (ed.) MODELS 2008. LNCS, vol. 5421, pp. 35–47. Springer, Heidelberg (2009). Scholar
  16. 16.
    Wimmer, M., Burgueño, L.: Testing M2T/T2M transformations. In: Moreira, A., Schätz, B., Gray, J., Vallecillo, A., Clarke, P. (eds.) MODELS 2013. LNCS, vol. 8107, pp. 203–219. Springer, Heidelberg (2013). Scholar

Copyright information

© IFIP International Federation for Information Processing 2018

Authors and Affiliations

  1. 1.Università degli Studi di BergamoBergamoItaly
  2. 2.Software Competence Center Hagenberg GmbHHagenbergAustria
  3. 3.Johannes Kepler UniversityLinzAustria

Personalised recommendations