Papyrus is a Unified Modeling Language (UML) modeling tool for the Eclipse Modeling Framework and provides tool support for executable UML modeling. It includes technologies for the simulation and debugging of models, as well as editing facilities to produce executable models more efficiently. The simulation and debugging part is handled by a plug-in called Moka, which relies on an implementation of the Foundational Subset for Executable UML Models (fUML) standard and the Precise Semantics of UML Composite Structures (PSCS) standard. These specifications formalize the execution semantics of a UML subset. In addition to graphical editing, Papyrus also supports the Action language for fUML (Alf) standard, with an editor and compiler for Alf.

The execution and simulation features of Moka allow one to provide input data required to execute the graphical fUML and textual Alf models. However, manual generation of input data might be suitable for small and simple models, but it is often not the case for real-life complex models. Similarly, test generation for executable models is a difficult and tedious task when performed manually. To address these issues, we present an Eclipse plugin, called the MATERA2-AlfTester (M2-AT), which implements an exhaustive simulation and test generation approach with the following objectives:

  1. generate test data for simulation to achieve maximum model coverage,
  2. run these inputs automatically in the Moka plugin to simulate the model
  3. generate a test suite with test oracle (expected output) that can be used for testing the system implementation
  4. generate a corresponding Java code skeleton for the fUML model which can be used as a starting point for system development.

MATERA2-AlfTester integrates with Papyrus and Moka tools and extends their functionally by allowing one to automatically generate test data, test suite with test oracle, and partial Java code at design time. We also present the simulation and testing process of MATERA2-AlfTester with the help of an example and demonstrate how exhaustive simulation and test generation with MATERA2-AlfTester can help designers in assessing and improving the quality of fUML models.

The figure below shows and overview of the approach and of its toolchain. Executable fUML activity diagrams are created with Papyrus and can be used for simulation in the Moka tool. The MATERA2-Alf tool, generates simulation inputs for the Moka tool that target 100% structural coverage of the activity diagram. The approach allows us to detect uninitialized objects in the model, unreachable paths, and syntax errors.

Test generation architecture for executable models

The same simulation inputs are automatically translated into jUnit tests that can be executed against the implementation of the system. As a side effect of our approach, a Java code skeleton can be generated from the fUML model.

More details can be found in Iqbal, Junaid  and Ashraf, Adnan and Truscan, Dragos and Porres, Ivan. MATERA2-AlfTester: An Exhaustive Simulation and Test Generation Tool for fUML Models.  In Euromicro Conference on Software Engineering and Advanced Applications (SEAA 2019), Kallithea, Chalkidiki, Greece. August 28 – 30, 2019 (author version)

Share This