Istituto di Scienza e Tecnologie dell'informazione A. Faedo Software Engineering Laboratory Tool support for model driven development in practice Antonino Sabetta ISTI-CNR, Pisa PisaTel Meeting Roma, 29 novembre 2007
MDD: what's it all about? Making software is a matter of: art and inspiration? craftsmanship? engineering best practices? industrial production (i.e. automated, repeatable)? Model Driven (MD) approaches advocate expressing design artifacts in a machine readable format automatically obtain new artifacts from existing ones model transformation code generation reverse engineering
What can I do with models that I can't do without Modeling as a means for... Better/easier/higher quality design Raising the level of abstraction Gain better understanding of design choices and their implications (Early) analysis functional verification extra functional verification (performance, schedulability) Automated implementation (i.e. code generation) you want code eventually, don't you?
Different tools for different purposes Metamodeling Model to model transformation UML modeling Code generation Model driven analysis
Different tools for different purposes Metamodeling Model to model transformation UML modeling methodology neutral methodology specific Code generation Model driven analysis
Papyrus UML feature highlights Eclipse based, free, open source, actively developed OMG standards compliant (v.2.0) open development process developed by knowledgeable people, directly involved in OMG standardization process (MARTE OMG profile for Modeling and Analysis of Real Time Embedded Systems) Both SysML and MARTE are already implemented in Papyrus (Papyrus's MARTE is the official reference implementation) Supports all the UML standard diagrams Extremely easy to extend with custom profiles (see next slides) Code generation (based on Acceleo); C++ and Java supported out of the box, other languages can be added with new templates
Why do I need extensions/annotations? The UML metamodel: is generic has several semantic variation points (bug or feature?) BUT it can be customized, specialized, constrained: UML profiles What can you do with UML profiles: tailor the language to your domain and to your development process and practices attach a semantics that suits your need (i.e. generate special code based on the information included in the stereotypes) augment the model with extra information that is necessary for performance predictions
Defining a custom profile with Papyrus
Defining a custom profile with Papyrus
Using a custom profile with Papyrus
Under the hood: XMI
Magicdraw (NoMagic Inc.) Pros: Compliant with v.2.0 family of OMG standards; interoperable Full support for Profiles and consistency checks with constraint language Actively developed and maintained Commercial support Cons: Proprietary tool, expensive Note: It's a general purpose UML modeling tool (does not attach a specific semantics to models, thus it is not capable e.g. to execute statecharts)
MagicDraw
MagicDraw
MagicDraw
UniMod Pros Development methodology based on statecharts and events Statecharts can be directly mapped to C++/Java code Note: UniMod assumes a particular semantics for UML statecharts and imposes a predefined design work flow. (All of this could be implemented under the hood via the UML profiling mechanism with a neutral modeling tool)
UniMod Cons UniMod 1.3 is based on obsolete UML 1.5 std. No support for custom annotations, no Profiles (neither custom nor standard profiles) No support for interchange, no interoperability UniMod 2 (was due for April 2007) seems to be dead
UniMod: structural modeling
UniMod: behavioral modeling
UniMod: behavioral modeling
UniMod code generation capabilities
iuml (Kennedy Carter) Distinguishing features (iumlite 2.2, free, March 2005) Executable models (simulates statecharts) Body of actions is specified with an action language (ASL), imperative with some declarative shortcuts for operation on sets Latest non free version claims to be capable of generating code from statemachines Shortcomings Based on obsolete UML standard (1.5) No profiles, no extensions (neither std nor custom) No import export in free edition
iuml (Kennedy Carter)
iuml (Kennedy Carter)
Modeling to automate implementation Code generation Acceleo Eclipse based incremental code generation produce code by populating templates the meaning of the model (how modeling elements map to actual code) is expressed in the code generation process Alternatives: AndroMDA, StringTemplate, JET
Conclusion Models are used for a number of purposes Tools cover different areas high level design, architectural modeling predictive analysis, early verification code generation, reverse engineering Different approaches some tools offer fuller use of the standard but require that the language and the design process be tailored for your purposes (very flexible, but exploit this flexibility implies making customizations) others come packaged with predefined design workflow and specialized features (quicker adoption, but less flexible)
Discussion Open vs closed vs proprietary interoperability is an issue support for std interchange formats Built in support for executable models Interfacing with 3rd party code generation engines Support for profiling/annotations Support for latest OMG standard specifications Active development; frequent updates and fixes Community support and good documentation