Implementation of a model based test case generator for UML state machines

Mateus Felipin Dalepiane · Lume (Universidade Federal do Rio Grande do Sul) · 2014

This work proposes the integration of a model-based test case generation framework for UML state machines into a commercial modeling tool. The framework was proposed by Heckeler et al. in 2013, and generates test cases for robustness testing of UML state machines modeled within Enterprise Architect. Heckeler’s work uses exported model files from Enterprise Architect (EA) to access the modeled state machine information. The test case generation is composed of three main tasks: abstract test case generation, executable test case generation and test cases execution control. The generation of the abstract test cases, called path lists, is responsible for extracting all the necessary information directly from the model, generate a new representation of the transition system that complies with the boolean satisfiability solver used to resolve transition guards, and run queries on this transition system to generate all abstract test cases in order to satisfy the target coverage. These abstract test cases are lists of transitions that should be executed in the state machine. The second task is responsible for transforming the path lists into executable test cases. In order to generate robustness tests, this task also extends the path lists with calls to all undefined transitions, using informations from the model. The executable test cases are based on CppUnit test suite. Besides generating the test cases this task also generate configuration scripts to control Gnu Debugger (GDB) during test execution. These scripts include commands for starting and stopping the recording needed for reverse transition execution, and are used to read the state encoding variables during runtime. The third task runs the executable test cases, uses GDB to extract the values necessary for verification and to accelerate the test case execution using GDB reverse execution. When an error is detected, this task outputs a trace that shows the triggers call order to facilitate the error reproduction. This work proposes an integrated solution within Enterprise Architect as a plugin, using EA Application Program Interface, in order to improve the end-user experience. As an initial integration work, it focuses on the integration of the first task, the abstract test case generation. In order to achieve this initial integration, this work proposes a C# state machine model to store all data extracted from EA, presented as a class diagram, and a software architecture to be used within the plugin, that can easily be extended to include both new test case generation techniques and test case coverages into it. The integrated test case generator validation is done using the same two state machines used in the framework proposal by Heckeler, by comparing the path list output from the previously implementation with the output from the EA integrated solution. The first state machine is a hash table implementation that comprises 3 states and 11 transitions. The second state machine is a traffic light controller implementation that comprises 11 states and 19 transitions.

Read the paper · More papers on PaperTik