MODEL-DRIVEN
ENGINEERING
SOME COLLECTED EXPERIMENTS
J. de Lara, E. Guerra, J. Sánchez Cuadrado
Computer Science Department
Universidad Autónoma de Madrid (Spain)
madSESE’2017
http://miso.es
WHO ARE WE?
2
Universidad Autónoma de Madrid
• Established in 1968.
• North part of Madrid (campus Cantoblanco).
• One of the top universities in Spain.
• >30000 students
• “Excellence” campus with CSIC (Spanish Research
Council).
Computer Science and Telecommunication
Engineering.
• Created in 1992.
• 96 full time professors.
No se puede mostrar la imagen. Puede que su equipo no tenga suficiente memoria para abrir la imagen o que ésta esté dañada. Reinicie el equipo y, a continuación, abra el archivo de nuevo. Si sigue apareciendo la x roja, puede que tenga que borrar la imagen e insertarla de nuevo.
WHO ARE WE?
3
Esther Guerra Juan de Lara Jesús Sánchez
Cuadrado
Antonio
Garmendia
Jesús J.
López
Fernández
Ángel
Mora
Segura
Pablo
Gómez
Professors
PhD
Students
Javier
Palomares
Sara
Pérez
Research
Project
Assoc.
http://miso.es
We are hiring!
WHAT DO WE DO?
Model-driven engineering
Meta-modelling
• Multi-level modelling. MetaDepth tool (http://metadepth.org)
• A-posteriori typing
Domain-Specific Languages
• Example-based DSL developmemt. MetaBUP
• Pattern-based DSL development. DSL-tao
• Domain-specific modelling in mobile devices. DSL-comet (iOS).
Model transformations
• Transformation reuse. Bento tool.
• Transformation analysis.
• Graph transformation.
4
5
Some
experiments
SOME EXPERIMENTS
Analysing meta-models
• Checking “smells” for refactoring into multi-level [1]
Analysing transformations
• Static analysis of transformations to discover errors [2]
Evaluating tools and notations (with users)
• DSL construction tools [3]
• Domain-specific tools [4]
6
[1] de Lara, Guerra, Sánchez Cuadrado: When and How to Use Multilevel Modelling. ACM
Trans. Softw. Eng. Methodol. 24(2): 12:1-12:46 (2014)
[2] Sánchez Cuadrado, Guerra, de Lara: Static Analysis of Model Transformations. IEEE Trans.
Softw. Eng. 2017 (in press)
[3] Pescador, de Lara: DSL-maps: from requirements to design of domain-specific languages.
Proc. ASE 2016: 438-443.
[4] Buezas, et al : Umbra Designer: Graphical Modelling for Telephony Services. Proc. ECMFA
2013: 179-191
MULTI-LEVEL
MODELLING
Multi-level modelling
• More than two meta-levels at a time
• Simplifies modelling in some scenarios
7
ProductType@2
VAT@1: double
price: double
Book: ProductType
VAT=18.0
price=10.0
mobyDick: Book
vs.
When is it good to use multi-level modelling?
• Five patterns whose occurrence signal a multi-level “smell”
Can it be applied often?
• Analysed a large corpus of more than 400 meta-models (OMG, ATL zoo)
• Pervasive in some domains (software architecture, enterprise/process
modelling)
• Relatively frequent in OMG specifications (over 35%)
How to apply multi-level modelling?
• We show how to map patterns in two-level modelling to multi-level
modelling
• We show refactorings of “real-world” examples
OUR MOTIVATION
8
TYPE-OBJECT
9
Intent: explicit modelling of types and instances
• Types can be added dynamically
• Features of types are fixed and known a priori
Also known as: Type object [Martin et. al 97], item descriptor
[Coad 1992], metaobject [Kiczales and Rivieres 1991]
Example: model product types (books, CDs) and their
instances, to be added on demand. Product types have a vat,
while instances have a price.
R. Martin, D. Riehle, F. Buschmann. 1997. Pattern languages of program design 3. A. Wesley.
P. Coad. 1992. Object-oriented patterns. Commun. ACM 35, 9 (1992), 152–159.
G. Kiczales, J. Des Rivieres. 1991. The art of the metaobject protocol. MIT Press.
TYPE-OBJECT SOLUTIONS
10
ProductType
Book
vat: double {readonly}
price: double
vat : double =4.0
GoF: Book
price = 35
ProductType
vat: double
Product
price: double
type1
Book: ProductType
vat = 4.0
:type
GoF: Product
price = 35
ProductType
Book:
ProductType
GoF: Book
vat@1: double
price: double
vat=4.0
price = 35
@2
@1
@0
Static types
Dynamic types
…
Multi-level
PRACTICAL APPLICABILITY
How often do these patterns occur?
Analysis of meta-model repositories:
• ATL meta-model zoo (305 meta-models) [8.5% occur.]
• OMG specifications (116 specs) [35%~38% occur.]
• ReMoDD (15 meta-models) [20% occur.]
• Articles in journals/conferences
84 meta-models with 459 occurrences (avg 5.5)
• Most common pattern is the type-object
• Most used solution is explicit types (~70%)
11
WHERE?
12
19
17
13
4
4
3
3
3
2 3
Enterprise/Process Modelling
Software Architecture
Systems/Software Modelling
Manufacturing
Reverse Engineering
Data modelling
Requirements
Bibliographic
Traceability
Metrics
#META-MODELS
153
85
48
46
19
14
10 9 8
4
#PATTERN
OCCURRENCES
EXPLICIT TYPES TO MULTI-LEVEL
13
• CloudML (6 T-O, 1 DF)
• 14 classes
• Multi-level solution
• 6 classes
14
No! Discard error
ATL
transf.
meta-
models
1: type
checking TDG
4: constraint
solving
potential
problems
errors,
warnings
3: transformation
analysis
2: create
TDG
annot.
ATL
model
Yes! Confirm
error
Check it out at:
http://miso.es/tools/anATLyzer.html
witness
found?
STATIC ANALYSIS OF (ATL)
TRANSFORMATIONS
ANATLIZER
15
http://www.miso.es/tools/anATLyzer.html
EVALUATION
ATL transformation zoo
• 101 transformations
• More than 4.000
problems found
• All transformations have
problems
16
Mutation testing of a synthetic transformation
• Precision 96%
• Recall 96%
DSL-MAPS
17
Evaluation
• Understandability, usefulness and completeness of synthesized meta-model
• User study with 7 engineers
• Likert scale (subjective) and
• Evaluation of produced artefacts (errors, completeness)
http://miso.es/tools/DSLtao.html
UMBRA-DESIGNER
18
Evaluation
• Productivity
• 2 users: One using Java code, the other using the DSL
• Evaluation of productivity gain on the basis of 10 tasks
• Results: productivity gain of 45% in average
EVALUATIONS IN MDE
User studies
• Hard!
• Difficult to have access to expert users
Evaluations based on artefact analysis
• We need (bigger) repositories!
• Of models, meta-models, transformations, etc
• ATL meta-model zoo: some of them really toy meta-models
• ATL transformation zoo: Buggy!
• Standards: slight variations in OCL
• Repositories of meta-models with OCL constraints
MDE techniques for software evaluations
• JavaCheck: a DSL for static analysis of Java programs
19
THANKS!
Questions?
Juan.deLara@uam.es
20
http://www.miso.es
modelling &
software engineering
research group

MDE-experiments

  • 1.
    MODEL-DRIVEN ENGINEERING SOME COLLECTED EXPERIMENTS J.de Lara, E. Guerra, J. Sánchez Cuadrado Computer Science Department Universidad Autónoma de Madrid (Spain) madSESE’2017 http://miso.es
  • 2.
    WHO ARE WE? 2 UniversidadAutónoma de Madrid • Established in 1968. • North part of Madrid (campus Cantoblanco). • One of the top universities in Spain. • >30000 students • “Excellence” campus with CSIC (Spanish Research Council). Computer Science and Telecommunication Engineering. • Created in 1992. • 96 full time professors. No se puede mostrar la imagen. Puede que su equipo no tenga suficiente memoria para abrir la imagen o que ésta esté dañada. Reinicie el equipo y, a continuación, abra el archivo de nuevo. Si sigue apareciendo la x roja, puede que tenga que borrar la imagen e insertarla de nuevo.
  • 3.
    WHO ARE WE? 3 EstherGuerra Juan de Lara Jesús Sánchez Cuadrado Antonio Garmendia Jesús J. López Fernández Ángel Mora Segura Pablo Gómez Professors PhD Students Javier Palomares Sara Pérez Research Project Assoc. http://miso.es We are hiring!
  • 4.
    WHAT DO WEDO? Model-driven engineering Meta-modelling • Multi-level modelling. MetaDepth tool (http://metadepth.org) • A-posteriori typing Domain-Specific Languages • Example-based DSL developmemt. MetaBUP • Pattern-based DSL development. DSL-tao • Domain-specific modelling in mobile devices. DSL-comet (iOS). Model transformations • Transformation reuse. Bento tool. • Transformation analysis. • Graph transformation. 4
  • 5.
  • 6.
    SOME EXPERIMENTS Analysing meta-models •Checking “smells” for refactoring into multi-level [1] Analysing transformations • Static analysis of transformations to discover errors [2] Evaluating tools and notations (with users) • DSL construction tools [3] • Domain-specific tools [4] 6 [1] de Lara, Guerra, Sánchez Cuadrado: When and How to Use Multilevel Modelling. ACM Trans. Softw. Eng. Methodol. 24(2): 12:1-12:46 (2014) [2] Sánchez Cuadrado, Guerra, de Lara: Static Analysis of Model Transformations. IEEE Trans. Softw. Eng. 2017 (in press) [3] Pescador, de Lara: DSL-maps: from requirements to design of domain-specific languages. Proc. ASE 2016: 438-443. [4] Buezas, et al : Umbra Designer: Graphical Modelling for Telephony Services. Proc. ECMFA 2013: 179-191
  • 7.
    MULTI-LEVEL MODELLING Multi-level modelling • Morethan two meta-levels at a time • Simplifies modelling in some scenarios 7 ProductType@2 VAT@1: double price: double Book: ProductType VAT=18.0 price=10.0 mobyDick: Book vs.
  • 8.
    When is itgood to use multi-level modelling? • Five patterns whose occurrence signal a multi-level “smell” Can it be applied often? • Analysed a large corpus of more than 400 meta-models (OMG, ATL zoo) • Pervasive in some domains (software architecture, enterprise/process modelling) • Relatively frequent in OMG specifications (over 35%) How to apply multi-level modelling? • We show how to map patterns in two-level modelling to multi-level modelling • We show refactorings of “real-world” examples OUR MOTIVATION 8
  • 9.
    TYPE-OBJECT 9 Intent: explicit modellingof types and instances • Types can be added dynamically • Features of types are fixed and known a priori Also known as: Type object [Martin et. al 97], item descriptor [Coad 1992], metaobject [Kiczales and Rivieres 1991] Example: model product types (books, CDs) and their instances, to be added on demand. Product types have a vat, while instances have a price. R. Martin, D. Riehle, F. Buschmann. 1997. Pattern languages of program design 3. A. Wesley. P. Coad. 1992. Object-oriented patterns. Commun. ACM 35, 9 (1992), 152–159. G. Kiczales, J. Des Rivieres. 1991. The art of the metaobject protocol. MIT Press.
  • 10.
    TYPE-OBJECT SOLUTIONS 10 ProductType Book vat: double{readonly} price: double vat : double =4.0 GoF: Book price = 35 ProductType vat: double Product price: double type1 Book: ProductType vat = 4.0 :type GoF: Product price = 35 ProductType Book: ProductType GoF: Book vat@1: double price: double vat=4.0 price = 35 @2 @1 @0 Static types Dynamic types … Multi-level
  • 11.
    PRACTICAL APPLICABILITY How oftendo these patterns occur? Analysis of meta-model repositories: • ATL meta-model zoo (305 meta-models) [8.5% occur.] • OMG specifications (116 specs) [35%~38% occur.] • ReMoDD (15 meta-models) [20% occur.] • Articles in journals/conferences 84 meta-models with 459 occurrences (avg 5.5) • Most common pattern is the type-object • Most used solution is explicit types (~70%) 11
  • 12.
    WHERE? 12 19 17 13 4 4 3 3 3 2 3 Enterprise/Process Modelling SoftwareArchitecture Systems/Software Modelling Manufacturing Reverse Engineering Data modelling Requirements Bibliographic Traceability Metrics #META-MODELS 153 85 48 46 19 14 10 9 8 4 #PATTERN OCCURRENCES
  • 13.
    EXPLICIT TYPES TOMULTI-LEVEL 13 • CloudML (6 T-O, 1 DF) • 14 classes • Multi-level solution • 6 classes
  • 14.
    14 No! Discard error ATL transf. meta- models 1:type checking TDG 4: constraint solving potential problems errors, warnings 3: transformation analysis 2: create TDG annot. ATL model Yes! Confirm error Check it out at: http://miso.es/tools/anATLyzer.html witness found? STATIC ANALYSIS OF (ATL) TRANSFORMATIONS
  • 15.
  • 16.
    EVALUATION ATL transformation zoo •101 transformations • More than 4.000 problems found • All transformations have problems 16 Mutation testing of a synthetic transformation • Precision 96% • Recall 96%
  • 17.
    DSL-MAPS 17 Evaluation • Understandability, usefulnessand completeness of synthesized meta-model • User study with 7 engineers • Likert scale (subjective) and • Evaluation of produced artefacts (errors, completeness) http://miso.es/tools/DSLtao.html
  • 18.
    UMBRA-DESIGNER 18 Evaluation • Productivity • 2users: One using Java code, the other using the DSL • Evaluation of productivity gain on the basis of 10 tasks • Results: productivity gain of 45% in average
  • 19.
    EVALUATIONS IN MDE Userstudies • Hard! • Difficult to have access to expert users Evaluations based on artefact analysis • We need (bigger) repositories! • Of models, meta-models, transformations, etc • ATL meta-model zoo: some of them really toy meta-models • ATL transformation zoo: Buggy! • Standards: slight variations in OCL • Repositories of meta-models with OCL constraints MDE techniques for software evaluations • JavaCheck: a DSL for static analysis of Java programs 19
  • 20.