Week 1: Introduction
17/01/2020 (c) King’s College London
Model-Driven Engineering (MDE)
Copyright By PowCoder代写 加微信 powcoder
Foundations
Safe reuse and composition
17/01/2020 (c) King’s College London
Model-Driven Engineering (MDE)
Foundations
Safe reuse and composition
Optimisation Language composition Debugging
17/01/2020
(c) King’s College London
Model-Driven Engineering (MDE)
Foundations
Safe reuse and composition
Optimisation Language composition Debugging
Model-Driven Engineering (MDE)
Applications
Biology Emergency Medicine Robotics
17/01/2020
(c) King’s College London
Foundations
Safe reuse and composition
Optimisation Language composition Debugging
Focus of this module
Model-Driven Engineering (MDE)
Applications
Biology Emergency Medicine Robotics
17/01/2020
(c) King’s College London
Motivation
Our software grows increasingly more complex
For example: Every 5 years, Thales systems grow by a factor of approx. 5 to 10
6000 5500 5000 4500 4000 3500 3000 2500 2000 1500 1000
17/01/2020
(c) King’s College London
ATC Networks Simulators C3I
FE Radar NCS
1984 1986 1988 1990 1992 1994 1996 1998 2000 2002
Size (KLOC)
Our software grows increasingly more complex – 2
Demir, Kadir & Caymaz, Ebru. (2016). Current Research Areas in Defense Software and Information Systems Project Management.
11th International Scientific Conference Defense Resources Management In The 21st Century.
17/01/2020 (c) King’s College London 5
Our software grows increasingly more complex – 3
SEI, “Virtual Integration for Improved System Design”, Redman et. al, 2010 https://wiki.sei.cmu.edu/aadl/images/d/de/SAVI_Virtual_Integration-AVICPS2010.pdf 17/01/2020 (c) King’s College London 6
We have too few professional software developers
By 2020, we will lack between 525,000 and 750,000 qualified IT professionals across Europe [1]
We cannot satisfy this demand only by educating more software engineers
→ Need more efficient ways of software development
→ Must enable domain experts to participate in software development
[1] N. van der Linden et al. Digital organisational frameworks and it professionalism – interim report. On-line: hps://bit.ly/2OoWp0S, 2018. [2] Institute of Coding: https://instituteofcoding.org/, accessed 23 October, 2019
17/01/2020 (c) King’s College London 7
A practical experiment – let’s build Minesweeper
17/01/2020 (c) King’s College London 8
Let’s do some work… Form into two sets of pairs: A and B
17/01/2020 (c) King’s College London 9
Let’s do some work…
Form into two sets of pairs: A and B
– Use the Java Minesweeper implementation at
https://classroom.github.com/a/oLERdTTs (also on KEATS)
1. Click on the link – this will create a new repo for you
– Use the Minesweeper implementation at
https://classroom.github.com/a/JNth9ZPW (also on KEATS)
1. Click on the link – this will create a new repo for you
17/01/2020 (c) King’s College London
Let’s do some work…
Form into two sets of pairs: A and B
– Use the Java Minesweeper implementation at
https://classroom.github.com/a/oLERdTTs (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
– Use the Minesweeper implementation at
https://classroom.github.com/a/JNth9ZPW (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
17/01/2020 (c) King’s College London
Let’s do some work…
Form into two sets of pairs: A and B
– Use the Java Minesweeper implementation at
https://classroom.github.com/a/oLERdTTs (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
– Use the Minesweeper implementation at
https://classroom.github.com/a/JNth9ZPW (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
17/01/2020 (c) King’s College London
Let’s do some work…
Form into two sets of pairs: A and B
– Use the Java Minesweeper implementation at
https://classroom.github.com/a/oLERdTTs (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer 4. Run the program
– Use the Minesweeper implementation at
https://classroom.github.com/a/JNth9ZPW (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
4. Run the program (right-click on the project
and choose “Run as Java Application”)
17/01/2020 (c) King’s College London
Let’s do some work…
Form into two sets of pairs: A and B
– Use the Java Minesweeper implementation at
https://classroom.github.com/a/oLERdTTs (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
4. Run the program
5. Explore the Java code to understand it
17/01/2020 (c) King’s College London
– Use the Minesweeper implementation at
https://classroom.github.com/a/JNth9ZPW (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
4. Run the program (right-click on the project
and choose “Run as Java Application”)
5. Open the .ggames file and understand it
Let’s do some work…
Form into two sets of pairs: A and B
– Use the Java Minesweeper implementation at
https://classroom.github.com/a/oLERdTTs (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
4. Run the program
5. Explore the Java code to understand it
– Use the Minesweeper implementation at
https://classroom.github.com/a/JNth9ZPW (also on KEATS)
1. Click on the link – this will create a new repo for you
2. Open Eclipse
3. Import the project from Git using the
standard Eclipse importer
4. Run the program (right-click on the project
and choose “Run as Java Application”)
5. Open the .ggames file and understand it
You have 10 minutes – don’t get lost in playing Minesweeper☺
17/01/2020 (c) King’s College London 9
Now enhance the program
Add a new feature:
Right-clicking on a hidden cell twice, should change it from a flag (“F”) to a question mark (“?”). This can be used to mark cells where the player suspects that their might be a bomb, but isn’t sure.
17/01/2020 (c) King’s College London 10
Now enhance the program
Add a new feature:
Right-clicking on a hidden cell twice, should change it from a flag (“F”) to a question mark (“?”). This can be used to mark cells where the player suspects that their might be a bomb, but isn’t sure.
In your pairs work through this list as far as possible:
1. Identify the places in the code you need to change
2. Identify what changes you need to make: what code do you need to add / remove / change? 3. Make the changes
4. Test them by running the program again
17/01/2020 (c) King’s College London 10
Now enhance the program
Add a new feature:
Right-clicking on a hidden cell twice, should change it from a flag (“F”) to a question mark (“?”). This can be used to mark cells where the player suspects that their might be a bomb, but isn’t sure.
In your pairs work through this list as far as possible:
1. Identify the places in the code you need to change
2. Identify what changes you need to make: what code do you need to add / remove / change?
3. Make the changes
4. Test them by running the program again
Prepare to report back to the class
– Take notes on what you discover:
– How many places in the code do you need to touch?
– How easy is it to find what changes need making and where? – Are you sure you’ve found all the places that need changing?
– Did you manage to implement the new feature? Did it work?
17/01/2020 (c) King’s College London 10
Now enhance the program
Add a new feature:
Right-clicking on a hidden cell twice, should change it from a flag (“F”) to a question mark (“?”). This can be used to mark cells where the player suspects that their might be a bomb, but isn’t sure.
In your pairs work through this list as far as possible:
1. Identify the places in the code you need to change
2. Identify what changes you need to make: what code do you need to add / remove / change?
3. Make the changes
4. Test them by running the program again
Prepare to report back to the class
– Take notes on what you discover:
– How many places in the code do you need to touch?
– How easy is it to find what changes need making and where? – Are you sure you’ve found all the places that need changing?
– Did you manage to implement the new feature? Did it work?
Remember you have decent IDE support for each of the implementations.
Use it to your advantage!
Some ideas below:
– Use Ctrl+Space to trigger a dropdown with
code-completion suggestions
– Use Ctrl (Cmd) + Left Click to navigate to the
definition of any identifier in your code
– Use code folding and unfolding to make it
easier to navigate around a long source file
17/01/2020 (c) King’s College London 10
Now enhance the program
Add a new feature:
Right-clicking on a hidden cell twice, should change it from a flag (“F”) to a question mark (“?”). This can be used to mark cells where the player suspects that their might be a bomb, but isn’t sure.
In your pairs work through this list as far as possible:
1. Identify the places in the code you need to change
2. Identify what changes you need to make: what code do you need to add / remove / change?
3. Make the changes
4. Test them by running the program again
Prepare to report back to the class
– Take notes on what you discover:
– How many places in the code do you need to touch?
– How easy is it to find what changes need making and where? – Are you sure you’ve found all the places that need changing?
– Did you manage to implement the new feature? Did it work? You have 15 minutes
Remember you have decent IDE support for each of the implementations.
Use it to your advantage!
Some ideas below:
– Use Ctrl+Space to trigger a dropdown with
code-completion suggestions
– Use Ctrl (Cmd) + Left Click to navigate to the
definition of any identifier in your code
– Use code folding and unfolding to make it
easier to navigate around a long source file
17/01/2020 (c) King’s College London 10
Plenary: what have you found?
So what was all of this about?
Worked directly in a general-purpose programming language
– All the complexity of how to solve the problem
– Mix of different concerns: domain logic, GUI management, efficiency, maintainability, …
– Difficult to understand / extend
– Need to understand all concerns to identify
correct places to change in correct way
17/01/2020 (c) King’s College London
Worked with domain-specific modelling language
– Focus on describing the problem, not the solution
– Focus on one concern: domain logic. Other concerns are hidden in solution implementation.
– Easier to understand / extend the domain logic
– Still just as difficult to extend other concerns
So what was all of this about?
Worked directly in a general-purpose programming language
– All the complexity of how to solve the problem
Worked with domain-specific modelling language
– Focus on describing the problem, not the solution
We used modelling to
– Mix of different concerns: domain logic, GUI – Focus on one concern: domain logic. Other conquer complexity
management, efficiency, maintainability, …
– Difficult to understand / extend
– Need to understand all concerns to identify
correct places to change in correct way
17/01/2020 (c) King’s College London
concerns are hidden in solution implementation.
– Easier to understand / extend the domain logic
– Still just as difficult to extend other concerns
Cost and Benefit of Modelling
What is modelling? What is a model?
What do you think?
What is modelling?
Modelling means using models to develop software
→ What’s a model? – Abstraction
– Reduction
– Representation – Pragmatics
Really want to get into this? Check out http://www.is.informatik.uni-kiel.de/thalheim/models.htm
17/01/2020 (c) King’s College London 16
What is modelling?
Modelling means using models to develop software
→ What’s a model? – Abstraction
– Reduction
– Representation – Pragmatics
A model is an abstraction of a part of the real world for a purpose. Models are represented in a modelling language. Models can have different pragmatics: they can be descriptive or prescriptive, or describe a vision of what reality should be like (to-be).
Really want to get into this? Check out http://www.is.informatik.uni-kiel.de/thalheim/models.htm
17/01/2020 (c) King’s College London 16
What’s the most important characteristic of models?
What do you think?
– Discuss with your neighbour – Reach an agreement
You have 5 minutes
17/01/2020 (c) King’s College London 17
Plenary: what is the most important characteristic of models?
Is modelling being used in practice?
Can you think of examples?
Examples of industrial use of modelling
Low-Code platforms (Mendix, Oracle, node-red, …) jHipster
/Docker (incl. the various swarm variants) Routing DSMLs in web frameworks
Dutch tax system
(Of course, any program is a model. The above are approaches that are more tightly focused on specific aspects and use dedicated languages.)
17/01/2020 (c) King’s College London 21
A survey on industrial use of modelling
., ., Rouncefield M., Kristoffersen S.: Empirical Assessment of MDE in Industry. International Conference on Software Engineering, 2011.
17/01/2020 (c) King’s College London 22
Types of models – Models as…
– Rough, incomplete models
– Often on paper or whiteboard
– Good for better communication
17/01/2020 (c) King’s College London 23
Types of models – Models as…
– Rough, incomplete models
– Often on paper or whiteboard
– Good for better communication
Blueprints
– Detailed models
– Often, but not always, produced electronically
– Handed to programmers to be manually implemented
– Models can be analysed more easily than full programs
17/01/2020
(c) King’s College London 23
Types of models – Models as…
– Rough, incomplete models
– Often on paper or whiteboard
– Good for better communication
Blueprints
– Detailed models
– Often, but not always, produced electronically
– Handed to programmers to be manually implemented
– Models can be analysed more easily than full programs
– Detailed, electronic models
– Formalised semantics – models can be executed by computer
– Interpretation or compilation (e.g., generation of Java code)
– More efficient programming; developers work at higher abstraction level
– Depends on abstraction gap:
– Low for UML: need to give almost as much detail as in a program
– High for more domain-specific modelling languages (e.g., our grid-games
17/01/2020
(c) King’s College London
language): need to give only absolute minimum of information 23
Cost–Benefit Curve for Modelling
Development Effort (idealised)
17/01/2020 (c) King’s College London
Cost–Benefit Curve for Modelling
Development Effort (idealised)
Without modelling
17/01/2020 (c) King’s College London
Cost–Benefit Curve for Modelling
Development Effort (idealised)
Without modelling
17/01/2020 (c) King’s College London
Cost–Benefit Curve for Modelling
Development Effort (idealised)
Without modelling
With modelling
17/01/2020 (c) King’s College London
Cost–Benefit Curve for Modelling
Development Effort (idealised)
Explicit modelling tends to create cost in the short term that is outweighed by the benefit in the long term.
Without modelling
With modelling
17/01/2020 (c) King’s College London
The MDE hype cycle
Visibility
17/01/2020 (c) King’s College London
The MDE hype cycle
Visibility
17/01/2020 (c) King’s College London
The MDE hype cycle
Visibility Peak of Inflated Expectations
Technology Trigger
Slope of Enlightenment
Trough of Disillusionment
Plateau of Productivity
17/01/2020
(c) King’s College London
The MDE hype cycle
Visibility Peak of Inflated Expectations
Technology Trigger Adoption Rate
Slope of Enlightenment
Trough of Disillusionment
Plateau of Productivity
17/01/2020 (c) King’s College London
The MDE hype cycle
Visibility Peak of Inflated Expectations
Technology Trigger Adoption Rate
Slope of Enlightenment
Trough of Disillusionment
Plateau of Productivity
17/01/2020 (c) King’s College London
Early Majority
Late Majority
Innovators
The MDE hype cycle
Visibility Peak of Inflated Expectations
Technology Trigger Adoption Rate
Slope of Enlightenment
Trough of Disillusionment
Plateau of Productivity
17/01/2020 (c) King’s College London
Early Majority
Late Majority
Innovators
Chasm of Adoption
The MDE hype cycle
Visibility Peak of Inflated Expectations
Plateau of Productivity
Technology Trigger
Adoption Rate
Slope of Enlightenment
Trough of Disillusionment
Late Majority
Early Majority
17/01/2020 (c) King’s College London
Innovators
Chasm of Adoption
The MDE hype cycle
Visibility Peak of Inflated Expectations
Plateau of Productivity
Technology Trigger
Adoption Rate
Slope of Enlightenment
Trough of Disillusionment
Late Majority
Early Majority
17/01/2020 (c) King’s College London
Innovators
Chasm of Adoption
Principles of modelling and MDD
Modelling vs Drawing
Drawing Tools Modelling Tools
17/01/2020 (c) King’s College London
Modelling vs Drawing Drawing Tools
Modelling Tools
– Highly flexible – good for models as sketches
– Bound by syntactical constraints of modelling language
– Can be cumbersome for models as sketches
17/01/2020 (c) King’s College London
Modelling vs Drawing Drawing Tools
Modelling Tools
– Highly flexible – good for models as sketches – Doesn’t “understand” meaning of drawings
– Bound by syntactical constraints of modelling language
– Can be cumbersome for models as sketches – “Understands” meaning of models
17/01/2020 (c) King’s College London
Modelling vs Drawing Drawing Tools
Modelling Tools
– Highly flexible – good for models as sketches – Doesn’t “understand” meaning of drawings
– Allows meaningless drawings
– Bound by syntactical constraints of modelling language
– Can be cumbersome for models as sketches – “Understands” meaning of models
– Prevents or flags incorrect models
17/01/2020 (c) King’s College London
Modelling vs Drawing Drawing Tools
Modelling Tools
– Highly flexible – good for models as sketches
– Doesn’t “understand” meaning of drawings
– Allows meaningless drawings
– Cannot be used for models as blueprints or
– Bound by syntactical constraints of modelling language
– Can be cumbersome for models as sketches – “Understands” meaning of models
– Prevents or flags incorrect models
– Can be computer interpreted – models as
blueprints or programs
17/01/2020 (c) King’s College London
Modelling vs Drawing Drawing Tools
Modelling Tools
– Highly flexible – good for models as sketches
– Doesn’t “understand” meaning of drawings
– Allows meaningless drawings
– Cannot be used for models as blueprints or
– Bound by syntactical constraints of modelling language
– Can be cumbersome for models as sketches – “Understands” meaning of models
– Prevents or flags incorrect models
– Can be computer
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com