Generation of C++ unit tests from abstract state machines specifications

Authors Silvia Bonfanti
Angelo Gargantini
Atif Mashkoor
Editors
Title Generation of C++ unit tests from abstract state machines specifications
Type in proceedings
Publisher IEEE
Volume Proceedings of the 2018 IEEE 11th International Conference on Software Testing, Verification and Validation Workshops
ISBN 978-1-5386-6352-3
DOI 10.1109/ICSTW.2018.00049
Month April
Year 2018
Pages 185-193
SCCH ID# 18034
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. Following the same approach, model-based testing suggests deriving also (unit) tests from abstract models. Previously, we have presented Asm2C++ [1] – a tool that translates Abstract State Machines (ASMs) to C++ code. In this paper, we extend the Asm2C++ tool such that it can now 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. We also present some experiments that prove the feasibility of the proposed approach.