ECE-Magazine October 2013 - page 17

S
OFTWARE
D
EVELOPMENT
17
October 2013
Time is money, especially when developing
complex systems. And it can often be that
time runs out and costs increase when finding
bugs at a late stadium of the process. The best
way to prevent such problems is a detailed
modeling process identifying architectural mis-
takes at an early stage of the development life-
cycle. The behavior of complex systems may
also be modeled, but models on paper are not
sufficient for describing dynamic aspects. To
avoid flaws in the conceptual models, executing
and testing them are crucial. Everyone is fallible,
but as a systems engineer you should focus on
reducing costly mistakes by using the best
available methods and tools. If a system is
fully described with a conceptual model, the
functionality may be revealed by static and dy-
namic model tests. The model being explored
is called “Model under Test” (MUT).
Static tests evaluate the correct syntax of the
model and pre-defined model guidelines. These
guidelines are similar to coding guidelines.
Thus, defining the context in which model ele-
ments may be used guarantees a consistent
modeling concept within a company. Static
tests are used to find logical flaws in the model,
e.g. if a decision within a process is not well
defined. This kind of flaw may also be found
by dynamic simulation tests. The finding of
syntactic flaws is independent of the modeling
language. Enterprise Architect includes a lot
of syntax rules but they can be expanded by
the user. The evaluation of modeling guidelines
is company- or even project-specific, and thus
must be defined by the user. The definition of
rules is based on the Enterprise Architect
object model and can be executed in different
programming and script languages including
OCL rules for validation purposes.
Dynamic tests evaluate the runtime behavior
of the system and point out bottlenecks and
bad configurations. Depending on the model-
ing language there are different models to de-
scribe the behavior. UML provides for example
activity -, state – and sequence diagrams.
SysML (System Modeling Language) is used
to model hardware-oriented systems, and thus
it additionally includes a pragmatic diagram.
This diagram describes the connection between
constraint blocks, each of them defining a cer-
tain function. SparxSystems provides a solution
for Enterprise Architect (release 7.5 upwards)
to simulate the SysML Pragmatic Diagram.
The simulation of activity diagrams (AD) and
state machines (StM) was made possible by
LieberLieber Software, a sister company of
SparxSystems Central Europe, with a plug-in
solution: the model simulation engine (MSE).
Simulation concepts: if a model needs input
data and produces output data during simula-
tion, the user has to prepare suitable input
data. This can be done in a manual and inter-
active manner during simulation or automati-
cally via prepared test data. The test data has
to correlate with requirements and restrictions
of the model. Moreover, the user can define
output data for a certain set of input data. If
the simulation starts with this kind of input
data, it should end with the anticipated output
data. In comparison of input and output data,
unit tests may be defined. If the model is a so-
named “continuous model” (the model has
no defined endpoint and runs continuously),
one can also define input and output data. In
this case the model unit test will be applied on
Flexible model-based testing of UML
Ads, UML StMs, and mock objects
By Horst Kargl,
LieberLieber Software
This article gives an
overview of model-based
testing via UML simulation
using the modeling platform
Enterprise Architect, and
describes how to use it in
combination with the model
simulation engine (MSE).
Figure 1. Correlation between the abstract
model and the external libraries used for
simulation
1...,7,8,9,10,11,12,13,14,15,16 18,19,20,21,22,23,24,25,26,27,...28
Powered by FlippingBook