=Paper=
{{Paper
|id=Vol-1560/paper2
|storemode=property
|title=UML Model Execution via Code Generation
|pdfUrl=https://ceur-ws.org/Vol-1560/paper2.pdf
|volume=Vol-1560
|authors=Gergely Dévai,Máté Karácsony,Boldizsár Németh,Róbert Kitlei,Tamás Kozsik
|dblpUrl=https://dblp.org/rec/conf/models/DevaiKNKK15
}}
==UML Model Execution via Code Generation==
UML Model Execution via Code Generation
Gergely Dévai, Máté Karácsony, Boldizsár Németh, Róbert Kitlei, Tamás Kozsik
Eötvös Loránd University, Faculty of Informatics
Budapest, Hungary
Email: {deva,kmate,nboldi,kitlei,kto}@elte.hu
Abstract—Simulating design models makes early verification generation. The results make it clear that the requirement
of the software’s business logic possible. Model simulators can about high runtime performance leads to the code generation
be implemented using an interpreter, but it provides limited solution. In case of model execution via code generation
runtime performance. This is only acceptable if the only use
case of the tool is interactive model execution and debugging. If a natural question arises: What is the difference between
the model executor tool is to be used for automated regression model execution (simulation) via code generation and model
testing, execution time becomes an important factor. In such cases compilation? While they seem to be similar at first sight, they
generating code is a better option compared to interpretation. are highly different, due to their different purposes:
This paper documents our experience from an ongoing project
which supports both the interactive and the automated model • Model simulation has to follow as many legal execution
simulation use cases via code generation. It proposes an archi- paths during intense testing as possible, to reveal possible
tecture and shows techniques we found useful in this setup, and errors. Model compilers have to generate code that takes
reports on a freely available UML model simulator implemented
along these lines. one legal execution path and is as performant as possible.
• Model simulation has to check if invariants of the model
I. I NTRODUCTION (e.g. multiplicity constraints) are kept at runtime. The
The two main use cases of a model simulator are (1) code generated by a model compiler will perform no
interactive model execution and debugging and (2) automated runtime checks, or just a limited amount, in order to meet
mass test case execution. In the first case, the tool has to the performance requirements.
• provide graphical user interface with animation of certain • The platform of a model simulator is the one where
diagrams (e.g. state machines), models are developed. Model compilation targets a given
• show object instances and their attribute values, platform, independent of the development one, and takes
• support breakpoints both on graphical model elements its specifics into account.
(e.g. states and transitions) and in textual action language, • Model simulation has to connect to the debug framework,
• provide usual debugging features like stopping on break while model compilation has no such obligation.
points, stepping, resuming the execution etc. • Model simulation has to be prepared to replay execution
In the automated test execution use case the simulator is traces. Model compilers have to support logging only.
used as part of a testing framework: The model is exercised • Model simulation can be a single threaded emulation of a
by a set of predefined test cases in a nightly regression testing concurrent model. Model compilers have to emit parallel
session or before each commit to the software repository. In code, if that is required by the target platform.
this case, the simulator • Model simulation has to provide quick feedback about the
• has to be fast, and
correctness of the business logic captured in the model.
• has to provide a command line user interface.
Results of the model compiler are deployed on the target
platform, which can be time consuming, and the runtime
Whenever a test case fails during the automated testing
results may include platform-specific errors.
session, it should be possible to examine the cause of the
failure in an interactive session. One possibility to achieve this The paper is organized as follows. The next section presents
is deterministic model execution: The simulator guarantees to related work. Section III shows the results of an experiment
walk through the exact same execution path each time for comparing the runtime performance of model execution via
a fixed input. However, UML models running with several interpretation, code generation and just-in-time compilation.
instances of active classes can be non-deterministic. A deter- An architecture for a code generation based model simulator is
ministic model simulator chooses only one execution path of proposed in Section IV, with special attention on the animation
the many possible. This severely limits the testing capabilities and breakpoint support, the necessary debug symbols, the
of the simulator. A better approach is to choose randomly debug interface of the target language, then communication
from the possible paths, and make the tool generate execution between the debugging front-end and the generated code, and,
traces during automated testing, which can be replayed in an finally, the termination of the execution. Section V reports on
interactive session. the current status and capabilities of the tool which is built
Section III will show measurement results on the runtime along the architecture discussed in this paper. The last section
performance of model execution via interpretation and code concludes the paper with a short summary.
9
II. R ELATED WORK to be migrated. The long-term plan is to use Moka for that
purpose.
In this section we give an overview of open source tools Regarding the closed source commercial products, the Ra-
that can simulate UML (or UML like models). The richest set tional Rhapsody tool [3] also needs to be mentioned as it
of model elements is supported by the BridgePoint tool [12], provides model execution capabilities.
open sourced [2] in 2014. It is originally based on the Shlaer-
Mellor method [15]. The tool is Eclipse-based. It consists of III. I NTERPRETATION , CODE GENERATION AND JIT
UML diagram editors, a model simulator and model compilers. An interpreter stores the internal state of an executed model
The simulator animates state machines, supports breakpoints (object instances, values of their attributes and actual state ma-
and provides other standard debugging features. BridgePoint chine states, message queues of signals etc.) as data. It queries
uses an interpreter to execute models. Our experience shows the model to find out the next action to take and changes
that its runtime performance is enough for the interactive use the model execution state accordingly. Another possibility to
case, but it needs improvement in the mass test execution use achieve model execution is to compile the model to program
case. code, then build and run it. It is also possible to combine
Foundational UML, or fUML for short [10], is a standard interpretation and compilation using just-in-time-compilation
defining formal execution semantics for a subset of UML. The (JIT). In this case the model is executed by an interpreter, but
goal of fUML is to be a basis for defining precise semantics for frequently executed or critically slow fragments are compiled,
richer UML subsets (like the PSCS [11] standard). A Java-like built and loaded into the process of the interpreter.
textual syntax for fUML, called Alf [9] is also standardized. In order to compare the performance of the three discussed
There are fUML and Alf reference implementations available. options, we have created an experiment with models limited
The fUML reference implementation is written in Java, and to a single state machine. A predefined number of instances of
follows closely the formal semantics definition of the standard. the state machine is created and a given number of signals are
The Alf reference implementation is integrated in the Eclipse sent to each of them. During the triggered a transitions, action
environment using Xtext for parsing and OCL [16] for seman- code snippets (assignments, conditionals and basic arithmetic)
tic checks. Alf execution is provided by transformation back are executed in the transition effect, state entry and exit.
to fUML activities and leveraging the fUML implementation. In the compilation cases, state machine logic is implemented
The efficiency of model execution was ignored in these via nested switch-case statements. The interpreter uses an
implementations. event matrix to look up the next state using current state
The above mentioned reference implementations them- and the received event. In case of JIT, the action code
selves do not provide model debugging or animation support. statements are compiled and the state machine logic itself
Moka [8] is an extension to the Papyrus UML editor [13]. It remains interpreted. Two variants of the this solution have been
simulates UML activity diagrams and provides basic debug- implemented: one that generates Java source code and uses the
ging support, such as breakpoints on actions. Moka uses the Java compiler to compile it to bytecode, while the other one
diagrams of Papyrus as graphical front-end for simulation and generates bytecode directly using the Javassist library [6].
debugging, and uses a modified version of the fUML reference Table 1 shows execution times in milliseconds of the four
implementation for the execution logic. Moka also provides an different implementations executing the same models with
interface which allows the definition of new execution engines. 1000 and 5000 instances and processing 10000 signals per
We also use this technology to inegrate our work with Papyrus, instance. Two different machines/platforms have been used
see section IV for the details. to increase confidence in the experiment: Configuration C1
Moliz [7] is a testing and debugging framework for fUML denotes a HP EliteBook8540w laptop with Intel Core i5 CPU
activities. It defines a test specification language, and extends @ 2.53 GHz and 4 GB RAM, running 64 bit Windows 7. C2
the fUML reference implementation with debugging and trac- is a HP EliteBook 9480m machine with Intel Core i5 CPU @
ing capabilities. The execution traces are used to decide if a 2 GHz and 8 GB RAM, also running 64 bit Windows 7.
given test case passes or fails. Since Moka and Moliz use the
fUML reference implementation, the performance limitations 1000 instances 5000 instances
discussed earlier also apply to these projects, questioning their Technology
C1 C2 C1 C2
scalability in the mass test execution use case.
Interpreter 11436 7687 69288 41192
Topcased [14] is a set of plugins for the Eclipse platform, Generated code 496 354 2849 2339
which is mainly aimed at the implementation of critical
JIT to Java 7295 4986 29796 13134
embedded systems. It uses Papyrus for model editing, and
JIT to bytecode 1468 1332 23583 10060
adds simulation capabilities. Topcased also provides visual
model simulation for state machines, but no breakpoint support Table 1: Execution times (ms) of interpretation, generated code
is implemented, neither have we found any way to use it and JIT
for automated testing. The project is discontinued and is
under migration to the PolarSys consortium [17]; however, The results show that, in this experiment, interpretation
the model execution capabilities of Topcased are not planned turned out to be 18-24 times slower than running generated
10
code. The different versions of JIT compilation are better, but
still 3-14 times slower than generated code. (We have carried
out further experiments, with very similar results.) This means
that designers of high-performance model execution engines
targeting mass test execution have to seriously consider code
generation as the technology to build upon.
IV. A RCHITECTURE
This section discusses various aspects of an architecture that
supports code generation based model execution.
A. Overview
Figure 2 shows an overview of the architecture of the tool
this experience report is based on. The figure is color-coded:
blue means third party components we build on, while the
orange elements were created to make model execution via
code generation possible.
In this setup, the Papyrus editor is used to edit the UML Fig. 2: Proposed architecture for model simulators based on
models, which are stored over the EMF-UML2 [1] meta model. code generation
This is the input of our code generator, which translates
the model to Java. The translation needs to be incremental
in order to have the generated code ready for execution in the model, we need to know when does the Java code in
whenever the user requests execution in the interactive use the back-end reach these particular points of execution.
case. The generated code is compiled (also incrementally) by We realize both animation and breakpoint support using
the standard Eclipse Java tooling. Java breakpoints. Each breakpoint in the model is mapped to
In section I, we have summarized that code generation for breakpoints in the generated Java code. When a state machine
model execution is different in many aspects from code gen- diagram needs to be animated, Java breakpoints are placed
eration for a target environment. Incremental transformation is on the code lines corresponding to entering into states and
an additional requirement, severely affecting the architecture triggering transitions. These breakpoints are managed through
of the generator. We are not aware of code generators ful- the Java Debug Interface (JDI). Whenever a breakpoint is hit
filling these requirements, therefore we decided to write this in the Java code, the execution is stopped and a notification is
component from scratch. delivered from the JDI. If the breakpoint being hit corresponds
When model execution or debug session is started by the to a breakpoint in the model, the user is notified and the
user, the compiled code is loaded into a newly created JVM. runtime waits for user action (e.g. stepping or resuming
This Java process is the back-end of the session, managed the execution). If the breakpoint was created for animation
through the Java Debug Interface (JDI). The front-end (i.e. purposes, the corresponding state or transition is highlighted
debug controls, animation etc.) is realized on one hand by the for a given amount of time, and then the execution of the Java
Eclipse Debug Framework (the standard debug tools), and on code is resumed via the JDI.
the other hand by Moka (the graphical model debugging and Note that creating Java breakpoints for animation purposes
animation functions). In order to connect the front-end with might result in a high amount of breakpoints managed (cre-
the back-end, a connection layer is needed which relays the ated, disabled, enabled, removed) by the JDI. In order to find
debugging and animation events in both directions. the right policies that ensure the scalability of the solution, we
In order to find the connection between the running Java have designed experiments to test the performance of the JDI,
code in the back-end and the animated model in the front, see Section IV-D for the results.
a set of debug symbols are used, which had been created by
C. Debug symbols and mappings
the model translation process in addition to the generated Java
code. Section IV-C gives further details on these symbols. During compilation of Java class files, the compiler inserts
the information needed to find the line of source code corre-
B. Animation and breakpoint support sponding to a given instruction. However, interactive model
While the model is being executed, the user should be able debugging should support highlighting the actual state in
to open up state machine diagrams corresponding to selected running state machines or stepping through them as well as
object instances, and see the current state of the instance stepping over lines of action code or highlighting them. To
or the active transition highlighted. In order to realize this, provide these debugging features, a mapping between model
information about entering into states and fired transitions elements and their generated Java source code is needed.
is needed from the back end. Similarly, if the user places This problem is partially solved by JSR 45: Debugging
breakpoints on states, transitions or on lines of action code Support for Other Languages [5]. It provides a standard way
11
for correlating Java byte code with source code of textual and then launches the target process with special command
programming languages other than Java. JSR 45 uses a data line options. These options are commanding the target virtual
structure called Source Map (SMAP) to specify the mapping machine to connect to the debugger process through a socket.
between the lines of code in the original source language From this point, we can use a VirtualMachine object in the
(which could be for instance the action language of the debugger to send commands to and receive events from the
modeling system) and the generated Java source code. These target virtual machine. This mechanism of JDT could be
source maps are injected into the binary class files using the entirely reused to start a model executor process. Only the
SourceDebugExtension attribute after their compilation. underlying IDebugTarget instance should be replaced to
The Java Debug Interface can then be configured to use the a custom implementation. IDebugTarget is an abstraction
given source mapping while accepting and reporting break- defined by the Eclipse Debug Framework (EDF), which is used
point and other location information during a debug session. A to control a debugger from the user interface (like stepping,
single class file could have multiple attached source mapping suspending and resuming), and to coordinate the presentation
information for multiple source languages. Each Source Map of the data fetched from the target process (for instance
has a name, and the debugger will use this identifier to select threads, stack frames and local variables).
the appropriate mapping. Communication with the target virtual machine is asyn-
Unfortunately, this source mapping facility works only for chronous. The debugger can set different kind of event re-
textual languages. However, for ordinary model elements, like quests on a machine, for instance to get notification about
states and transitions which are represented mostly graphically a breakpoint hit at a specified location. The virtual machine
on the user interface, a virtual line mapping can be provided. will provide events in an event queue, corresponding to event
For non-textual elements, the Source Map will contain virtual requests. Each request could be enabled or disabled, and has
line numbers, and another mapping will be used to resolve a suspend policy. Based on the suspend policy of the corre-
these into the original UML elements. Like the Source Map, sponding request, the processing of an event could suspend
this data can also be created during Java code generation. all threads of the target machine. It also could suspend only
While it is also possible to store this mapping from virtual the source thread of the event, or continue its work without
line numbers to UML elements directly inside a class file interruption. When the machine is suspended by an event, the
using a custom attribute, in the tool presented in this paper execution could be resumed manually. Events are delivered in
it is currently serialized into a separate binary file and loaded sets by the event queue, as several events could be fired by a
by the debugger itself. virtual machine at the same time.
Because the naming rules of UML allow element names To place a breakpoint in the model execution process, the
which are not valid as Java identifiers, the code generator debugger creates a breakpoint event request. This request
assigns a unique Java identifier to each UML named element contains only the location of the given breakpoint. The cal-
that has a corresponding Java element. Names in the action culation of this location involves the usage of debug symbols
code are also provided with unique identifiers. The resulting and mappings presented in the previous section. For example,
identifier-to-name mapping is stored along with the virtual line when a breakpoint is placed on the entry of a state in a state
mapping to let the development environment show the original machine, the location resolution will follow the next steps:
names of model elements during debugging. 1) Calculate the fully qualified name of the Java class
which contains the code for the given state
D. Using the Java Debug Interface
2) Fetch the virtual line number of the given state entry
The Java Debug Interface (JDI) defines a high-level Java 3) Get a reference to the class from the target virtual
interface to access debugging capabilities of a running Java machine
virtual machine. It is the front-end part of the Java Platform 4) Use the class reference and the virtual line number to
Debugger Architecture (JPDA) [4]. Eclipse Java development get a JDI location
tools (JDT) also uses this technology to implement its debug- As a Source Map is installed on the generated class, the map-
ger. As JDI supports the inspection and manipulation of the ping between virtual line numbers and lines of the generated
connected virtual machine’s state through a simple API, it is a Java source code is available. It makes it possible to resolve
convenient choice to provide interactive visual debugging for the virtual line number to a bytecode offset inside a method.
UML models. The API is provided under the com.sun.jdi Before resolving, the debugger can select which Source Map to
package, bundled with JDK distributions. use from the available ones using the setDefaultStratum
JDI provides the following four ways to connect a debugger method on the VirtualMachine instance.
with a target process: The target machine, once it hits a breakpoint, emits a
1) Debugger launches target breakpoint event through its event queue. The breakpoint event
2) Debugger attaches to running target contains the JDI location of the breakpoint. The location
3) Target attaches to running debugger specifies a virtual line number and a reference to the containing
4) Target launches debugger class. The resolution to a model element can be done in a
The default Java process launching mechanism of Eclipse similar way as in the previous case, using the debug symbols
JDT uses the third option, as it creates a listening connector saved for the class earlier at code generation time.
12
When a breakpoint event suspended the virtual machine, its We have taken into consideration other methods of com-
internal state can be inspected, or even modified. For example, munication with the runtime. Because Java technology is used
Java local variables can be mapped to variables in action code on both sides of the communication, using virtual memory
of the modeling language, and presented to the user. It is also is not favourable. Sockets and files could be used to transmit
possible to implement expression evaluation, and to alter the information, but the debugger provides a higher-level interface.
value of a variable.
E. Terminating the execution
The VirtualMachine object can also be used to ter-
minate the target machine or to disconnect from it, enabling Model execution can terminate two ways. Either the model
another debugger to attach to the target. terminates normally (active object instances get to their final
Models that have to be handled by the model simulator states or get deleted) or the user stops the execution using
may contain a large number of model elements, therefore they the debugging controls on the user interface. The latter one,
induce a large number of potential breakpoint locations. We premature termination, has to be enabled, because certain
have conducted an experiment to determine how the number models take a long time to terminate or might not terminate
of breakpoints affects performance. The experiment was run at all.
on an Intel Core i7 CPU @ 3.4 GHz and 8 GB RAM, running Two different kinds of non-termination can be identified.
64 bit Windows 8. Either the state transitions of a state machine or one of the
action code blocks of the model may contain an infinite loop.
The non-termination of a state machine is easier to handle,
BPs 10 100 1000 10,000 20,000
because control is given back to the runtime at least once in
Passes 5000 500 50 1 1
every cycle.
BP hits 50000 50000 50000 10000 20000 User initiated termination of the execution can be done in
Run 4464 5126 12175 16952 69482 different ways. First, interrupting the JVM is the simplest
Run/100 8.928 10.25 24.35 169.52 347.41 solution, however in general, it prevents the runtime from
Set 112 1602 4965 freeing its allocated resources, like log files written. On a Unix
Disable 66 1750 5753 system, sending a kill signal to the JVM process enables it to
Table 3: Execution times (ms) of breakpoint scenarios run its resource deallocation code, but this is not a platform-
independent way of stopping the virtual machine.
The other way to stop the program is to somehow com-
The test cases in Table 3 set individual breakpoints on state- municate with it to stop its execution. It could be possible
ments (which, in the experiment, simply increase a counter) on to use the debugger to this purpose, but our goal was to
separate lines. The row BPs shows the number of breakpoints; stop the virtual machine regardless if it has an attached
the test cases loop over them Passes times for a total of debugger or not. For this, we have implemented an alternative
BP hits breakpoint hits. When the execution of the virtual way of communication with the runtime using sockets. The
machine hits a breakpoint, execution is handed over to the development environment can send a terminate message to
testing application. the runtime when the user decides to stop the execution.
The tests show that the execution time is quite dependent on When the runtime is initialized, a control thread is started
the number of breakpoints: for the same number of total break- to receive control messages like the terminate message over
point hits (50,000), the execution time nearly doubles when the socket connection with the environment. When it receives
using 1000 breakpoints instead of only 10. If we increase the the terminate message it closes all open resources, and finally
number of breakpoints further, the degradation is even more terminates the JVM.
apparent: the average time to hit 100 breakpoints (Run/100
row) doubles between 10,000 and 20,000 breakpoints. V. T OOL IMPLEMENTATION
Furthermore, breakpoints have to be set before execution We are in the process of developing a proof-of-concept
can progress toward them. Setting a low number (less than model executor tool [18] which we are releasing on a monthly
1000) breakpoints is almost instantaneous and not shown in basis. The tool is usable in two ways: via an interactive GUI
the table, however, as the number of breakpoints increase, we integrated with Eclipse, and via a command line interface. This
see that the cost of simply setting them approaches 10% of section gives an overview the capabilities of the two as of the
passing through all of them. time of the post-conference version of this paper.
These results show that a visual model debugger that is The interactive user interface is used to visually inspect
using generated code for execution must limit the number the execution of a model. It uses the Moka extension of the
breakpoints it uses. Fortunately, the model debugger needs Papyrus framework to display and edit the model elements.
to keep breakpoints only on lines that correspond to model The tool currently supports the most important class modelling
elements visible to the user (for animation) and model break- features of UML: classes, associations, flat state machines.
points set by the user. To further optimize performance, the The action code support includes object creation and deletion,
debugging environment can disable breakpoints that are likely linking and unlinking objects via associations, navigation
to be used again instead of removing them. through associations, sending signals, accessing attributes and
13
operations, basic operations of primitive types and sequences. log messages should be are explicitly visible here; they are
Action code is executed in a run-to-completion manner. The also available on the GUI tool, set to reasonable defaults.
models can communicate with external code via external
classes and operations callable from outside the model. These
model artifacts can be stereotyped and the tool generates Java
skeletons for them to be implemented by the user in order to
build up the connection to the external code.
Fig. 5: Code generation and model execution log of the
command line version of the tool
A. Runtime performance
We have measured the runtime performance of model
execution using the command line version of our tool. The
test model has two parameters: the number of object instances
Fig. 4: The GUI of the tool during a model debugging session (N ) and the number of iterations (M ). The model first creates
N object instances and performs N link operations, then
Visually, the most eye-catching feature of the tool is its starts the iterations. Each iteration consists of 9 signal sending
capability to visualise model execution. Once a model is operations, the same number of state transitions, 1 object
loaded, the user has to make a debug configuration, where deletion, 1 object creation, 1 link and 1 unlink operations,
he chooses the class that will be instantiated, and a feed 2 association navigations and the evaluation of 10 branch
function that drives the model by generating events. When conditions. After the M iterations, all existing N objects and
execution is started, the active state is visually highlighted their N links are deleted.
on the model. The user can make execution progress to the The measurement was done on an HP EliteBook notebook
next state manually, but by default animation is turned on: with Intel Core i5-3437U CPU @ 1.9 GHz and 8 GB RAM
the transitions happen after a set time amount. The user can running 64 bit Windows. The limit of each measurement
set breakpoints on the states and transitions, and when one is was 11 minutes, the empty cells in table 6 denote longer
hit, execution is paused. The tool can also log transitions, and (interrupted) experiments.
store execution traces which can later be replayed, producing
the same execution. (sec) N = 102 N = 103 N = 104 N = 105
Figure 4 shows a model being executed, stopped at a break- M = 102 1 1 8 -
point on state Hello. As logging is turned on by default, the M = 103 1 2 19 -
bottom of the screen shows the most recent state transition log M = 104 3 12 113 -
messages. As execution is paused, the user can conveniently M = 105 9 67 - -
turn off the animation option in the Animation Configuration M = 106 63 601 - -
view if he so chooses, and then continue execution with the M = 107 - - - -
Suspend toolbar button, the leftmost one depicted. The Debug
view must be open and the executing state machine selected Table 6: Execution times (sec) of the performance test model
for the Suspend button to be enabled; while it is possible to with N objects and M iterations
have several models executing at the same time, it is usually
hard to follow and inadvisable, as they have to use the same The results show that, up to 1000 instances and 1000
display. iterations, the model was executed within a couple of seconds.
The command line tool is used to automate test case Up to 10000 objects and 10000 iterations the execution time
execution. It uses the same execution engine as the GUI was under 2 minutes. This already covers the volume of usual
tool, therefore it expects similar arguments: model, class, feed regression and nightly testing on model level within reasonable
function, and path settings for source and generated files, logs execution time. On the other hand, we expected better scalabil-
and traces. Figure 5 shows a sample output of the command ity when increasing the number of object instances with a fixed
line tool after having run the same model as Figure 4. Options number of iterations. We plan to review the generated code and
about where to place the generated files and how detailed the the runtime module to find the cause of the degradation.
14
VI. S UMMARY ACKNOWLEDGMENT
In this paper we have analysed technical aspects of code We express our gratitude to Ericsson for the financial
generation based UML model simulation. The main motivation support of this research.
for this solution is higher runtime performance, required by
R EFERENCES
non-interactive model-level testing use cases. On the other
hand, the same execution engine should also serve interactive [1] EMF-UML2 project. http://wiki.eclipse.org/MDT-UML2.
[2] Executable Translatable UML Open Source Editor.
model debugging sessions. The paper gives detailed descrip- https://www.xtuml.org/.
tions of the techniques we found useful to solve this challenge. [3] IBM. Rational Rhapsody family. www.ibm.com/software/products/en/
The technical content of the paper is based on the design and ratirhapfami.
[4] Java Platform Debugger Architecture (JPDA). http://docs.oracle.com/
implementation of a model simulator in industrial cooperation. javase/8/docs/technotes/guides/jpda/.
Our experience with this tool confirms that the architecture [5] Java Specification Requests 45: Debugging Support for Other Lan-
and techniques presented in the paper are working well in guages. https://jcp.org/en/jsr/detail?id=45.
[6] Javassist library. http://www.csg.ci.i.u-tokyo.ac.jp/∼chiba/javassist/.
practice. The incremental code generation, triggered by saving [7] Stefan Mijatov, Philip Langer, Tanja Mayerhofer, and Gerti Kappel. A
the model, is silently running in the background and does not Framework for Testing UML Activities Based on fUML. In Proceedings
have impact on the model editing process. We faced many of the 10th International Workshop on Model Driven Engineering,
Verification and Validation (MoDeVVa) co-located with 16th Interna-
technical difficulties to make this process work well: The life tional Conference on Model Driven Engineering Languages and Systems
cycle of the different builders, integration of the incremental (MODELS 2013), pages 1–10, 2013.
model query engine, interworking with the model editor and [8] Moka. http://wiki.eclipse.org/Papyrus/UserGuide/ModelExecution.
[9] Object Management Group. Action Language for Foundational UML
its resource handling processes are issues which all need to (ALF), standard, version 1.0.1. http://www.omg.org/spec/ALF/, 2013.
be solved correctly to make the user experience smooth. [10] Object Management Group. Semantics of a Foundational Subset for
So far, we have not found conceptual limitations of the Executable UML Models (fUML), standard, version 1.1.
http://www.omg.org/spec/FUML/1.1/, 2013.
code generation based approach. Most probably, it would be [11] Object Management Group. Precise Semantics of UML Composite
easier to show information about the runtime state of an Structures (PSCS), standard in preparation, version 1.0 beta 1.
interpreter than the internals of generated code running in a http://www.omg.org/spec/PSCS/1.0/Beta1/, 2014.
[12] OneFact. BridgePoint xtUML tool. http://onefact.net/.
separate virtual machine. On the other hand, the sophisticated [13] Papyrus. http://wiki.eclipse.org/Papyrus.
framework for debugging Java programs is a solid basis to [14] Nadege Pontisso and David Chemouil. Topcased combining formal
build model debuggers on. The expected runtime performance methods with model-driven engineering. In Automated Software En-
gineering, 2006. ASE’06. 21st IEEE/ACM International Conference on,
gain over interpreters makes the approach worthwhile. pages 359–360. IEEE, 2006.
We experience that having a good model simulator is only [15] Sally Shlaer and Stephen J. Mellor. The Shlaer-Mellor method. Project
one tiny piece of the infrastructure needed to make executable Technology white paper, 1996.
[16] Technical Committee ISO/IEC JTC1, Information technology, in collab-
UML modelling work in an industrial setup: User friendly oration with the Object Management Group (OMG). Object Constraint
model editors, model validators, model compare-and-merge Language (OCL). Standard, International Organization for Standardiza-
tools, version control and team work support, refactoring tools tion, Geneva, Switzerland, April 2012.
[17] Topcased migrates to PolarSys.
and model compilers are all needed to make a toolchain http://polarsys.org/topcased-migrates-polarsys.
practical. [18] xUML-RT Model Executor.
http://modelexecution.eltesoft.hu/.
15