Keynote at Educators Symposium, ACM/IEEE 19th Intl. Conference on Model Driven Engineering, Languages, and Models
1. Dipartimento di Ingegneria e Scienze
Università degli Studi dell’Aquila
dell’Informazione e Matematica
Teaching Modeling at the
time of disillusionment
from code generation to model management
Alfonso Pierantonio
2. Dipartimento di Ingegneria e Scienze
Università degli Studi dell’Aquila
dell’Informazione e Matematica
Teaching Modeling at the
time of disillusionment
from code generation to model management
Alfonso Pierantonio
Model-Driven Engineering
3. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
3
Roadmap
What is Modeling?
– MDE vs UML
Teaching Modeling
– Teaching Abstraction
– Teaching Automation
– Teaching Modeling in L’Aquila
Disillusionment
– How relevant is MDE in practice
– An experiment
How to better sell MDE
– Model Management
Additional Remarks
– Abstraction already in Languages
– Metamodeling in collaborative spreadsheets
– Tooling
Conclusions
4. While I poured efforts in reporting
objective facts, I am inclined to
believe that I’m biased
5. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
5
What is Modeling
The forms of modeling can range from spontaneous
sketches to formal, machine readable models
Zarwin, Z., Bjekovic, M., Favre, J. M., Sottet, J. S., & Proper, H. A. (2014).
Natural Modelling. Journal of Object Technology, 13(3), 4-1.
6. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
6
What is Modeling
Modeling underpins the most crucial activities in
software design and development: understanding,
communicating, and analyzing software systems
Depending on when/how they come to life, models
can also be classified as
– descriptive, a representation of a system already existing
– prescriptive model, a representation of a system intended
to be built
Bézivin, J. (2005). On the unification power of models. Software &
Systems Modeling, 4(2), 171-188.
Muller, P. A., Fondement, F., Baudry, B., & Combemale, B. (2012).
Modeling modeling modeling. Software & Systems Modeling, 11(3), 347-
359.
7. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
7
What is Modeling
Within Modeling several approaches that focus on
models can be distinguished (*)
– Model-Based Engineering
– Model-Driven Engineering
– Model-Driven Development
However, realistic scenarios tend to blur the
distinction among the approaches
(*) D. Ameller, “SAD: Systematic Architecture Design, A Semi-Automatic
Method,” master’s thesis, Universitat Politècnica de Catalunya, 2010.
8. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
8
What is Modeling
MDSML
conformsTo
System
generatedFrom
9. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
9
What is Modeling
MDSML
conformsTo
System
generatedFrom
If behavior is generated,
some form of validation on
M might be needed
10. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
10
What is Modeling
MDSML
conformsTo
System
generatedFrom
Analysis
Model
generatedFrom
2
feedback
Model is analyzed
and feedback can
be back-propagated
to the modeler
11. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
11
MDE vs UML
Over the years there have been a certain confusion
about MDE and UML
– MDE neither depends on, or implies the use of UML
• Using UML does not mean you are doing MDE
• Doing MDE does not mean you must be using UML
– MDE can be supported by any modelling language that
• has a metamodel/grammar/well-defined structure; and
• has automated tools that allow the construction and manipulation of
models
Paige, Richard F., and Louis M. Rose. "Lies, Damned Lies and UML2Java."
Journal of Object Technology 12, no. 1 (2013).
12. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
12
What is MDE
– Abstraction permits to capture relevant conceptual
structures of a domain and leverage them together with
their interrelationships
– Automation permits to perform operations over models
that are not limited to code generation
MDE = abstraction + automation
13. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
13
Teaching Modeling
Teaching Modeling is not an easy task and can be
done in different manners
– often it is split into a number of courses
– the order in which such courses are given might not be
optimal, result of a «spontaneous» organization over the
years
– different lecturers may have different visions on what is
relevant and what is not, how modeling should be taught,
whether MDE is dead or still the sexiest thing on earth
This has been partly already discussed at EduSymp
14. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
14
Teaching Modeling
Most of the time the following are considered
mandatory topics for an introductory course
– Metamodeling
– Modeling
– Model Transformations
However, while model transformations partially
account for automation, building metamodels does
not imply abstraction skills
15. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
15
Teaching Abstraction
Students have difficulties in identifying and using
appropriate abstractions
– programming abstractions does not easily leverage to
modeling abstractions
– difficulty in finding the right granularity, which information to
include and not to include
– tool complexity adds unnecessary difficulty and let the
students feel less confident and motivated
– modeling is often perceived by student as unnecessary, not
part of the «real stuff», lack of motivation again
France, Robert B. "Teaching programming students how to model:
Challenges & opportunities.” EduSymp @ MoDELS 2011
16. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
16
Abstraction
Models are abstractions that enable to deal with
complex reality in a simplified way
– early analysis to detect faults or unwanted behavior
– communication between stakeholders, designers, etc
– to persist and retain knowledge within an organization
Models have a purpose: they can be used in a cost-
effective way (simpler, safer, cheaper) in place of
reality for some cognitive purpose.
20. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
20
Wrong models: four humours
Hippocrates believed the body contained four fluids,
called humours: blood, yellow bile, black bile, and
phlegm.
Bloodletting was used to remove excess humour to
restore balance and cure sickness.
Physician Benjamin Rush (one of the signers of
the Declaration of Independence) recommended
bloodletting to George Washington, the first U.S.
president, who died after having 3.75 liters of blood
removed from his body within a 10 hour period as
treatment for a throat infection.
21. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
21
Automation
The automation of the manual process of punching
paper tape in the 1940s is considered the first form of
«automatic programming» !
22. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
22
Automation
The automation of the manual process of punching
paper tape in the 1940s is considered the first form of
«automatic programming» !
When models are formal, they can be automatically
manipulated by programs written with dedicated
languages
m1
m2
m3
m4
23. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
23
Automation
Model transformations are required to perform complex tasks,
including
– non destructive incremental changes
– round-tripping engineering,
– traceability management
Using standard programming languages is challenging,
suboptimal, and prone to errors
24. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
24
Teaching Transformations
From a student perspective learning transformation
languages is to some extent easier than abstraction
– starting with well-designed metamodel is an advantage as
navigating models might be less complex and more
consistent
However, according to my experience
– learning how to use hybrid languages present intrinsic
difficulties because of their intrigued semantics
• called rules, lazy rules, etc
• students tend to have less problems in using the declarative sub-
language of ATL, for instance
• learning ETL after ATL is also easier
25. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
25
Teaching Code Generation
Code or text generation is typically done with
templating languages, like Acceleo
Despite the large abstraction gap between domain
models and code, generators are rarely coupled with
model transformations
– It seems to me that students prefer to use templating
languages over model-to-model transformation languages
Typically students do not encounter particular
problems in learning templating languages
26. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
26
Teaching Code Generation
While templating languages are not difficult to learn,
code generation is not easy
– it requires a deep knowledge of the target platform, ie
students must be good developers on the platform, must
know the languages, architecture and patterns
– It goes far beyond a normal modeling course
– it is typically a bottom-up process where recurrent patterns
are identified and embodied in syntactical structures to be
leveraged in a metamodel
From many sides it has been advocate that code
generation might compiler construction skills, not
sure though
27. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
27
Main Tasks in MDE
A typical MDE infrastructure might require
– Modelling Environment
• Metamodel definition (Ecore, MOF, KM3, Kermeta)
• Syntax definition (EMF Text, TCS, xText, GMF, Eugenia, Syrius, etc)
• Syntax-Directed Editor
– Code Generation
• Model-to-Text (Acceleo, JET, Xpand, etc)
– Model Management
• Model-to-Model (horizontal) transformations
• Model Weaving
• Model Compare, Diff, Merge
28. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
28
Teaching Modeling in L’Aquila
There is a long-standing tradition in teaching
Modeling at the University of L’Aquila
– already in 1996/96 modeling-related concepts were given
at the 3rd year of the CS degree program
– over the years several course offered quite focused content
on several aspects of model-based software analysis and
architectures
– in 2007 the course of Model-Driven Engineering has been
initiated
Nowadays, several course are given in the area of
modeling covering quite diverse topics
33. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
9-10
Model-Driven Engineering
Software Architecture
Software Quality
Engineering
Software
Engineering
Programming Languages
and Compilers
SEM
1
2
3
4
5
6
7
8
…
TeachingModelinginL’Aquila
bachelormaster
34. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
9-10
Model-Driven Engineering
Software Architecture
Software Quality
Engineering
Software
Engineering
Programming Languages
and Compilers
OO Software DesignDatabases
Fondamenti di
Programmazione
SEM
1
2
3
4
5
6
7
8
Architettura degli
Elaboratori
Laboratorio di Architettura
degli Elaboratori
Sistemi
Operativi
Algoritmi
Tecnologie del
Web
Teoria della Calcolabilità
e Complessità
Ricerca Operativa
e Ottimizzazione
Reti di Calcolatori
…
…
…
TeachingModelinginL’Aquila
bachelormaster
35. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
9-10
Model-Driven Engineering
Software Architecture
Software Quality
Engineering
Software
Engineering
Programming Languages
and Compilers
OO Software DesignDatabases
Fondamenti di
Programmazione
SEM
1
2
3
4
5
6
7
8
Analisi Matematica
Architettura degli
Elaboratori
Lingua Inglese
B1
Fisica
Matematica
DIscreta
Laboratorio di Architettura
degli Elaboratori
Probabilità e
Statistica
Sistemi
Operativi
Algoritmi
Ricerca Operativa
e Ottimizzazione
Tecnologie del
Web
Teoria della Calcolabilità
e Complessità
Ricerca Operativa
e Ottimizzazione
Reti di Calcolatori
…
…
…
…
TeachingModelinginL’Aquila
bachelormaster
36. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
9-10
Model-Driven Engineering
Software Architecture
Software Quality
Engineering
Software
Engineering
Programming Languages
and Compilers
SEM
1
2
3
4
5
6
7
8
…
TeachingModelinginL’Aquila
bachelormaster
38. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
38
How relevant is MDE in practice
For years MDE has been sold as a code generation
solution. However, there is some evidence that code
generation isn’t significant enough to adopt MDE
– Training costs and organization changes are too high
– MDE developers needs to have both software development
and abstraction skills as well as an in-depth understanding
of the domain
– It appears that MDE developers need also compiler
development skills alongside abstraction skills
Whittle, Jon, John Hutchinson, and Mark Rouncefield. "The state of practice
in model-driven engineering." IEEE software 31.3 (2014): 79-85.
40. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
40
An experiment
Wanted to check how relevant MDE is in the
academia and in the industry
– Therefore, I queried the EU CORDIS database to check
how many MDE-related projects have been accepted over
the years
– I searched only for items that have
• document-type: projects
• subject: ICT
• contained “model-driven” and “software”
44. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
It reflects the
– the strategic vision and intends of who designs EU
project calls
– the skills of perspective research and industrial units
participating in project consortiums
HowisMDErelevant?
45.
46. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
FP7-ICT
The objective of ICT research under the EU’s
Seventh Framework Programme (FP7) is to
improve the competitiveness of European
industry – as well as to enable Europe to master
and shape the future developments of these
technologies so that the demands of its society
and economy are met.
FP7-IDEAS-ERC
Specific programme to support fundamental and
exploratory research projects led by individual
researcher's teams
HowmuchMDEisbeingused?
47.
48.
49.
50.
51. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
51
How to better sell MDE!
We should stop selling MDE as a technology for
doing things faster or for generating code
– those who are interested in code generation, it is because
they know MDE can be useful for them
– those who are not familiar with MDE, won’t be easily
convinced in using MDE because of code generation, even
if they are going to make a try the risk for a failure cannot
be neglected
54. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
54
Model Management?
Model management is any activity which involves
relationships among modeling artifacts
– Keeping models consistent or synchronized
• Model-to-Model Transofrmations, Model Weaving
– Model Versioning, Differencing, Merging, etc
– Co-Evolution
– Traceability Management
– Persistency and Megamodel-based Repository
Most of such activities required the ability to use
abstraction in relationships, which are often given in
terms of models
56. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
56
Abstraction already in languages
According to my experience teaching (domain)
abstraction should be taught alongside object-
oriented programming
– Classes in the OOP sense can represent concepts and
might correspond to metaclasses, relationships can be
represented as well
– A DSML can be represented by means of a UML class
diagram and therefore can be represented with a collection
of classes
57. Gaetano Bresci – Dell’Anarchismo e Monarchia, Monza (Italy)
9-10
Model-Driven Engineering
Software Architecture
Software Quality
Engineering
Software
Engineering
Programming Languages
and Compilers
OO Software DesignDatabases
Fondamenti di
Programmazione
SEM
1
2
3
4
5
6
7
8
Architettura degli
Elaboratori
Laboratorio di Architettura
degli Elaboratori
Sistemi
Operativi
Algoritmi
Tecnologie del
Web
Teoria della Calcolabilità
e Complessità
Ricerca Operativa
e Ottimizzazione
Reti di Calcolatori
…
…
…
TeachingModelinginL’Aquila
bachelormaster
58. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
58
Metamodeling in collaborative spreadsheets
A convenient way of demonstrating the practice of
abstraction, ie how to draft domain-specific
metamodels, is by using Google Sheets
– It is possible to let student write their own “metamodel”
since the first lectures
– At MDH students wrote a (partial version of a) «building
description language» during the first lecture
– It can be done in a collaborative manner
59. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
59
MDE Forge
Tooling is an issue, students perceive tools in a
negative sense and this weakens their confidence
– I plan to use MDE Forge as a collaborative modeling
platform in order to hide technical difficulties in installing
and maintaining in a consistent state tools
– MDE Forge provides online workspaces for team
collaborations, where users can have their artifacts and run
their transformations
– Metrics, transformation analysis, model/metamodel
clustering are provided
– Course exercitations and exercises to be assigned to
student can be designed and reused o
60. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
60
Conclusions
Well, sometimes I have the impression that we have
more definitions of Modeling than users
– Thus it is difficult to agree about what Modeling is and how
should be taught
However, there is a general acceptance that MDE is
not just about code generation
– A more holistic view would put more emphasis on model
management: abstraction is not only about models but also
about relationships among them
• eg weaving models, traceability models, etc
61. Alfonso Pierantonio - Oct 3, 2016 EduSymp @ MoDELS 2016
61
Conclusions
According to my experience learning abstraction can
be more difficult than learning a (declarative)
transformation language
– Hybrid languages pose difficulties to students who do not
fully grasp their semantics
Abstraction can be taught alongside Object-Oriented
Programming, its initial practice can be done with
collaborative spreadshit