According to best practices of model-driven engineering, the implementation of a system should be obtained from its model through a systematic model-to-code transformation. We present in this paper a methodology supported by the Asm2C++ tool, which allows the users to generate C++ code from abstract state machine models. Thanks to Asm2C++, the implementation is generated in a seamless manner with an assurance of potential bug freeness of the generated code. Following the same approach, model-based testing suggests deriving also (unit) tests from abstract models. We extend the Asm2C++ tool such that it can automatically produce unit tests for the generated code. Abstract test sequences, either generated randomly or through model checking, are translated to concrete C++ unit tests using the Boost library. In a similar manner, also, scenarios are generated in a behavior-driven development (BDD) approach. To guarantee the correctness of the transformation process, 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. The process has been used to validate our model-to-code transformations.

(2020). Design and validation of a C++ code generator from Abstract State Machines specifications [journal article - articolo]. In JOURNAL OF SOFTWARE. Retrieved from http://hdl.handle.net/10446/150836

Design and validation of a C++ code generator from Abstract State Machines specifications

Bonfanti, S.;Gargantini, A.;
2020-01-01

Abstract

According to best practices of model-driven engineering, the implementation of a system should be obtained from its model through a systematic model-to-code transformation. We present in this paper a methodology supported by the Asm2C++ tool, which allows the users to generate C++ code from abstract state machine models. Thanks to Asm2C++, the implementation is generated in a seamless manner with an assurance of potential bug freeness of the generated code. Following the same approach, model-based testing suggests deriving also (unit) tests from abstract models. We extend the Asm2C++ tool such that it can automatically produce unit tests for the generated code. Abstract test sequences, either generated randomly or through model checking, are translated to concrete C++ unit tests using the Boost library. In a similar manner, also, scenarios are generated in a behavior-driven development (BDD) approach. To guarantee the correctness of the transformation process, 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. The process has been used to validate our model-to-code transformations.
articolo
2020
Bonfanti, Silvia; Gargantini, Angelo Michele; Mashkoor, A.
(2020). Design and validation of a C++ code generator from Abstract State Machines specifications [journal article - articolo]. In JOURNAL OF SOFTWARE. Retrieved from http://hdl.handle.net/10446/150836
File allegato/i alla scheda:
File Dimensione del file Formato  
asm2Cpp_JSEP.pdf

Open Access dal 25/11/2020

Descrizione: This is the peer reviewed version of the following article: Bonfanti, S, Gargantini, A, Mashkoor, A. Design and validation of a C++ code generator from Abstract State Machines specifications. J Softw Evol Proc. 2020; 32:e2205, which has been published in final form at https://doi.org/10.1002/smr.2205. This article may be used for non-commercial purposes in accordance with Wiley Terms and Conditions for Use of Self-Archived Versions.
Versione: postprint - versione referata/accettata senza referaggio
Licenza: Licenza default Aisberg
Dimensione del file 2.46 MB
Formato Adobe PDF
2.46 MB Adobe PDF Visualizza/Apri
Pubblicazioni consigliate

Aisberg ©2008 Servizi bibliotecari, Università degli studi di Bergamo | Terms of use/Condizioni di utilizzo

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10446/150836
Citazioni
  • Scopus 25
  • ???jsp.display-item.citation.isi??? 19
social impact