tures. The design for concurrency of generated code
is based on multi-thread of POSIX. The code gener-
ation pattern extends the IF-ELSE/SWITCH patterns
and uses a hierarchical structure to preserve the state
machine hierarchy.
We implemented our pattern as part of the Papyrus
modeling tool. We evaluated our tool by conducting
experiments on the semantic-conformance and effi-
ciency of generated code. The conformance is tested
under PSSM: 62 of 66 tests passed. These results are
a good hint that our tool preserves the UML State
Machine semantics during code generation. For ef-
ficiency, we used the benchmark defined by the Boost
library to compare code generated by our tool to other
approaches. The results showed that our tool pro-
duces efficient code that runs fast in event processing
speed and is small in executable size.
Code produced by our tool, however, consumes
slightly more memory than that of the others at run-
time. In future work, we will fix this issue by mak-
ing multi-thread part of generated code more concise.
Furthermore, we will use the pattern to support Java
code generation from UML State Machines.
REFERENCES
Badreddin, O., Lethbridge, T. C., Forward, A., Elaasar, M.,
Aljamaan, H., and Garzon, M. A. (2014a). Enhanced
code generation from uml composite state machines.
In Model-Driven Engineering and Software Develop-
ment (MODELSWARD), 2014 2nd International Con-
ference on, pages 235–245. IEEE.
Badreddin, O., Lethbridge, T. C., Forward, A., Elasaar, M.,
and Aljamaan, H. (2014b). Enhanced Code Genera-
tion from UML Composite State Machines. Model-
sward 2014, pages 1–11.
Balser, M., B
¨
aumler, S., Knapp, A., Reif, W., and Thums,
A. (2004). Interactive verification of uml state ma-
chines. In International Conference on Formal Engi-
neering Methods, pages 434–448. Springer.
Blech, J. O. and Glesner, S. (2005). Formal verification of
java code generation from uml models. In . . . of the
3rd International Fujaba Days, pages 49–56.
Booch, G., Rumbaugh, J., and Jacobson, I. (1998). The
Unified Modeling Language User Guide, volume 3.
Boost Library (2016a). Boost C++. http://www.boost.org/.
[Online; accessed 04-July-2016].
Boost Library (2016b). Meta State Machine. http://
www.boost.org/doc/libs/1 59 0 b1/libs/msm/doc/
HTML/index.html. [Online; accessed 04-July-2016].
Boost Library (2016c). State Machine Benchmark.
http://www.boost.org/doc/libs/1 61 0/libs/msm/doc/
HTML/ch03s04.html.
Boost Library (2016d). The Boost Statechart Library. [On-
line; accessed 04-July-2016].
Butenhof, D. R. (1997). Programming with POSIX threads.
Addison-Wesley Professional.
Charfi, A., Mraidha, C., and Boulet, P. (2012).
An optimized compilation of uml state machines.
In 2012 IEEE 15th International Symposium on
Object/Component/Service-Oriented Real-Time Dis-
tributed Computing, pages 172–179.
Dom
´
ınguez, E., P
´
erez, B., Rubio, A. L., and Zapata, M. A.
(2012). A systematic review of code generation pro-
posals from state machine specifications.
Douglass, B. P. (1999). Real-time UML : developing effi-
cient objects for embedded systems.
Forward, A., Lethbridge, T. C., and Badreddin, O. (2010).
Perceptions of software modeling: A survey of soft-
ware practitioners. In in 5th Workshop from Code
Centric to Model Centric: Evaluating the Effec-
tiveness of MDD (C2M: EEMDD), 2010. Available:
http://www. esi. es/modelplex/c2m/papers. php. Cite-
seer.
G
´
erard, S., Dumoulin, C., Tessier, P., and Selic, B. (2010).
19 papyrus: A uml2 tool for domain-specific language
modeling. In Model-Based Engineering of Embedded
Real-Time Systems, pages 361–368. Springer.
IBM (2016a). IBM Rhapshody and UML differ-
ences. http://www-01.ibm.com/support/docview.wss?
uid=swg27040251. [Online; accessed 04-July-2016].
IBM (2016b). Ibm Rhapsody. [Online; accessed 04-July-
2016].
Jusiak, K. (2016). State Machine Benchmark. https://
github.com/boost-experimental. [Online; accessed
20-Oct-2016].
Katz, R. H. and Borriello, G. (2005). Contemporary logic
design.
Knapp, A. (2004). Semantics of UML State Machines.
Lavender, R. G. and Schmidt, D. C. (1996). Active Object.
Context, pages 1–12.
LISE. Papyrus Software Designer. https://wiki.eclipse.org/
Papyrus Software Designer.
Magic, N. (2016). Magic Draw. https://
www.nomagic.com/products/magicdraw.html. [On-
line; accessed 14-Mar-2016].
Mussbacher, G., Amyot, D., Breu, R., Bruel, J.-m., Cheng,
B. H. C., Collet, P., Combemale, B., France, R. B.,
Heldal, R., Hill, J., Kienzle, J., and Sch
¨
ottle, M.
(2014). The Relevance of Model-Driven Engineer-
ing Thirty Years from Now. ACM/IEEE 17th Interna-
tional Conference on Model Driven Engineering Lan-
guages and Systems (MODELS), pages 183–200.
Nethercote, N. and Seward, J. (2007). Valgrind: a frame-
work for heavyweight dynamic binary instrumenta-
tion. In ACM Sigplan notices, volume 42, pages 89–
100. ACM.
Niaz, I. A., Tanaka, J., and others (2004). Mapping UML
statecharts to java code. In IASTED Conf. on Software
Engineering, pages 111–116.
OMG (2016). Precise Semantics of UML State Machines
(PSSM) Revised Submission. [Revised Submission,
ad/16-11-01].
Papyrus (2016). Moka Model Execution. https://wiki.
eclipse.org/Papyrus/UserGuide/ModelExecution.
[Online; accessed 01-Nov-2016].
MODELSWARD 2017 - 5th International Conference on Model-Driven Engineering and Software Development
218