Version control for models -- From research to industry and back again (Models and Evolution 2016...

48
© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 1 Version Control for Models From Research to Industry and Back Again Philip Langer [email protected]

Transcript of Version control for models -- From research to industry and back again (Models and Evolution 2016...

Page 1: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 1

Version Control for ModelsFrom Research to Industry and Back Again

Philip [email protected]

Page 2: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 2

● 2009 - 2012: PhD Student and junior researcher○ Version Control for Models, model transformation, MBE○ First presentation at a conference was at MoDELS 2009:

Composite model operations in the context of version control

● 2012 - 2014: Post Doc and senior researcher○ Version Control for Models, model transformation, MBE○ Model simulation, execution, debugging, model-based testing

My Background

Page 3: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 3

● 2014 - now: EclipseSource in Vienna○ Open source technology and service provider○ Support customers in applying OS Eclipse technologies

■ Sponsored open-source development■ Integration and customization■ Developer support, consulting, and training

○ Eclipse committer (projects in the ecosystem of EMF)○ Main focus

■ Building Eclipse-based modeling tools■ Industrial-quality version control support for models■ Architecture board of the Papyrus IC

My Background

Page 4: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 4

● Tooling that enables...○ working on shared models○ changing models separately in isolated branches○ obtaining differences among model versions○ sharing changes with others○ merging changes with changes others have made

Version Control for Models

mastermaster

featureX

Page 5: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 5

● Tooling that enables to efficiently use git for models

● Isn’t git on its own enough?

Version Control for Models

Taken from https://github.com/KnowitLabs/Project-Workflow-and-Conventions

Page 6: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 6

● Tooling that enables to efficiently use git for models

Version Control for Models

Page 7: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 7

● Tooling that enables to efficiently use git for models

Version Control for Models

Page 8: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 8

● Tooling that enables to efficiently use git for models

Version Control for Models

origin

rightleft

Page 9: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 9

● Tooling that enables to efficiently use git for models

Version Control for Models

origin

rightleft

What are the differences?

What are the differences?

Page 10: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 10

● Tooling that enables to efficiently use git for models

Version Control for Models

origin

rightleft

Are there conflicts?

~

Page 11: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 11

● Tooling that enables to efficiently use git for models

Version Control for Models

origin

rightleft

Apply differences (merge)

+

Page 12: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 12

● Tooling that enables to efficiently use git● On model-level● For Papyrus models

→ Seamless integration of

Version Control for Models

Page 13: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 13

● Tooling that enables to efficiently use git● On model-level● For Papyrus models

→ Seamless integration of

Version Control for Models

Page 14: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 14

○ A generic model differencing and merging framework○ Compare and merge the on the model level○ Open source project in the Eclipse ecosystem

○ Generic algorithms■ Make use of the metamodel to obtain knowledge on logical structure■ EMF’s Reflection API to access and compare values generically■ Support every modeling language that is specified in EMF

✔ Model matching✔ Model comparison✔ Model conflict detection✔ Merging of model differences

Model Differencing with EMF Compare

Page 15: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 15

Model Differencing with EMF Compare

Page 16: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 16

● Model comparison phases○ Matching

Finding corresponding model elements

○ DiffingIdentifying differences amongcorresponding model elements

○ Analysis of differencesEquivalences, dependencies, andconflicts among differences

EMF Compare’s Comparison Process

Page 17: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 17

● Model comparison phases○ Matching

Finding corresponding model elements

○ DiffingIdentifying differences amongcorresponding model elements

○ Analysis of differencesEquivalences, dependencies, andconflicts among differences

EMF Compare’s Comparison Process

Page 18: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 18

● Model comparison phases○ Matching

Finding corresponding model elements

○ DiffingIdentifying differences amongcorresponding model elements

○ Analysis of differencesEquivalences, dependencies, andconflicts among differences

EMF Compare’s Comparison Process

Page 19: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 19

● Model comparison phases○ Matching

Finding corresponding model elements

○ DiffingIdentifying differences amongcorresponding model elements

○ Analysis of differencesEquivalences, dependencies, andconflicts among differences

EMF Compare’s Comparison Process

Page 20: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 20

Comparison Model

Match Model● Matches of corresponding elements● Scope of the comparison

Difference Model● List of differences of each side● Generic differences

○ Reference change○ Attribute change○ …

Relationships among differences● Equivalences● Dependencies● Implications● Conflicts

● Model comparison phases○ Matching

Finding corresponding model elements

○ DiffingIdentifying differences amongcorresponding model elements

○ Analysis of differencesEquivalences, dependencies, andconflicts among differences

EMF Compare’s Comparison Process

Page 21: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 21

EMF Compare’s Comparison Process

Comparison Model

Match Model● Matches of corresponding elements● Scope of the comparison

Difference Model● List of differences of each side● Generic differences

○ Reference change○ Attribute change○ …

Relationships among differences● Equivalences● Dependencies● Implications● Conflicts

Merge viewer

Merge engine

Page 22: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 22

Selected Challenges

Page 23: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 23

● Crucially important but challenging○ Users get really angry if the merge breaks the model!○ Combination of potential input is huge (changes, model elements, …)○ Dozens of corner cases and nasty combinations

● Fuzz testing○ Run software under test with pseudo random input○ Monitor software under test during execution○ Check for crashes and failures

Reliability

Software

Input-independentpostcondition

Fuzz Generator

Test coverage

Page 24: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 24

● Goal○ Find combination of model changes applied to an EMF model○ Cause erroneous matching, diffing, and/or merging

● Fuzz Testing Framework for EMF tools○ Part of EMFStore○ Repeatedly run JUnit tests with fuzzed input○ Pseudo-randomly generate/mutate EMF models

● Basic Idea○ Generate an EMF model conforming to a metamodel: m1○ Copy and mutate this model: m2○ Compare and merge in both directions: m1→2 and m2→1○ Compare m1 with m2→1 and m2 with m1→2○ Assert that there are no differences

■ Between m1 and m2→1■ Between m2 and m1→2

Reliability

m1

Fuzz Generator

m2

Compare & Merge(r → l, l → r)

m1 m2== ==m2→1 m1→2

Page 25: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 25

● EMF Compare and EGit (integration of git in Eclipse)

○ EMF Compare extends EGit ■ Handling of involved model resources■ Comparisons among branches, references, tags■ Merge, rebase, and cherry-pick

○ Git has a file-by-file way of working○ Intercepting the merge of single model files is not enough

Model Versioning with EMF Compare and EGit

Page 26: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 26

Model Versioning with EMF Compare and EGit

Page 27: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 27

Model Versioning with EMF Compare and EGit

Page 28: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 28

● EMF Compare and EGit (integration of git in Eclipse)

○ EGit had to be extended to support so-called logical model support■ “Logical model” is a set of logically interrelated files■ EMF Compare provides those logical models for EMF

○ EMF Compare handles connected model resources as a whole■ Update of cross-file references■ Propagation of model element deletions

→ Support for model fragmentation operations→ Support for file operations in EMF Compare

Model Versioning with EMF Compare and EGit

Page 29: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 29

Generic model comparison is on the EMF model level.

Gap between Generic Model Comparison and Papyrus

Page 30: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 30

But this is not enough!

Gap between Generic Model Comparison and Papyrus

Papyrus

Page 31: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 31

But this is not enough!

Papyrus

Gap between Generic Model Comparison and Papyrus

Hides complexity of the modeling

language

Offers composite actions and types

Provides dedicated views

Especially with UML-based

DSMLs

Page 32: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 32

But this is not enough!

Gap between Generic Model Comparison and Papyrus

Papyrus

?

Gap between Modeling Editor and Model Versioning Tools

Page 33: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 33

Gap between Generic Model Comparison and Papyrus

Papyrus EMF CompareHow a user applies a change How EMF Compare sees the change

...

Page 34: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 34

Gap between Generic Model Comparison and Papyrus

Papyrus

“Papyrus Compare” Generic Model Comparison

Page 35: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 35

Gap between Generic Model Comparison and Papyrus

Papyrus EMF + Papyrus CompareHow a user applies a change How Papyrus Compare shows the change

...

Page 36: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 36

“Papyrus Compare”

● Seamless Papyrus integration✔ Support for UML Profiles✔ Support for UML Profile migration✔ Grouping of several composite editing actions✔ Specific conflict handling for those actions✔ Direct integration of model decorations✔ Integration of Papyrus diagram styling✔ Specific handling of meta-information (di)✔ ...

Page 37: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 37

● Papyrus is a DSM platform itself○ Custom model decoration and diagram styling○ Custom composite model element patterns○ Custom composite model editing actions○ Custom conflict and merge rules○ ...

Gap between Generic Model Comparison and Papyrus DSML

Page 38: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 38

Gap between Model Versioning Tools and Modeling Editors

Page 39: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 39

Future Challenges

Page 40: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 40

● DSML customizations are redundantly and manually implemented○ Incremental post-processing of comparison model○ Customization of UI components○ But this customization replicates the customization of Papyrus*

● Goal○ Perform DSML customization once → see the effect everywhere

● Shared DSML Customization Model○ Defines element patterns (“element types”)○ Defines composite operations○ Customization model is consumed by Papyrus, EMF Compare, ...

● Support for “customization of customizations” is crucial

Single-sourcing the Customizations for DSMLs

Page 41: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 41

● Better support for diagrams and tables○ Different domains have different requirements, backgrounds, preferences○ Diagram-oriented users, table-oriented, model-tree-oriented users

● Diagram-oriented users want to see all changes on the diagram○ Not only diagram changes, also model changes○ Synchronized diagram support

■ New model element → new shape■ Change dependencies need to be adapted

○ Integration with auto-layouting support■ Auto-layout after merge■ Conflicts on diagrams?

Better Concrete Syntax Comparison for DSMLs

Page 42: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 42

● Different user roles use different views and syntaxes○ System architect vs. electrical engineer○ High-level vs. detailed views○ Diagram-oriented users vs. textual-oriented users○ But they still work on shared models

User-oriented Multi-view/Multi-syntax Comparison for DSMLs

Page 43: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 43

User-oriented Multi-view/Multi-syntax Comparison for DSMLs

Page 44: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 44

User-oriented Multi-view/Multi-syntax Comparison for DSMLs

Page 45: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 45

● EUREKA project: “Hybrid Modeling”○ Better integrating textual and graphical modeling○ Papyrus for Real-Time as a case study

User-oriented Multi-view/Multi-syntax Comparison for DSMLs

Page 46: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 46

● Resilience to problems in the model○ Modeling tools are too restrictive and assume a well-formed model○ We can’t really recover if there is something wrong (broken model, unresolved

parts)○ Compare merge markers for text○ More resilient modeling tools with quick-fix support

● Model review○ Gerrit (or github) code review for models○ Support reviewing, commenting, and annotating changes○ Model/diagram changes, obviously

Further Topics

Page 47: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 47

● Open consortium with a common goal○ Developing a universal, industry-ready, open-source MBE solution○ Based on Eclipse Papyrus and many other open-source components

● Strong collaboration○ Tool users○ Tool providers○ Research and academia

● Independent of the domain○ Systems modeling○ Architecture modeling○ Enterprise modeling, …

● Talk to us, if you are interested to collaborate https://wiki.polarsys.org/Papyrus_IC

Papyrus Industrial Consortium

Page 48: Version control for models -- From research to industry and back again (Models and Evolution 2016 keynote)

© 2016 EclipseSource | http://eclipsesource.com/vienna | Philip Langer | Models and Evolution 2016 | Version Control for Models 48

Thank you very much!

● Open source collaboration

● Follow us on collaborative-modeling.org

● Contact us

○ Papyrus IC Research & Academia Committee○ [email protected]

Related Sessions

TomorrowOSS4MDE Workshop

Wednesday EveningWeclome Reception