Download - Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

Transcript
Page 1: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

Version Control for Graphs as a Basis of Version Control for Models

Z. Protić

M. F. van Amstel

M.G.J. van den Brand

T. Verhoeff

Page 2: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 2

Problem statement

• Define a generic method for version control of models• It should work for graph-based models

• It should be possible to use it with existing tools

• It should be easy to use

Page 3: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 3

Solution

• Represent all models as graphs• Use state-based versioning

• Differences are calculated based on structure of the models

• Use the experience of the existing versioning systems (CVS, SVN) to define the functions of the model versioning system

Page 4: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 4

Graphs used to represent models

• Graphs consist of:• Labeled nodes

− Each node is uniquely identified

• Labeled edges

Example graph

Page 5: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 5

Graphs used to represent models

• Graphs can be transformed to structured text.

Example graph

O1

O2

O3

O4

O1, O2, E1

O1, O4, E2

Textual representation

Bi-directionaltransformation

Page 6: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 6

Graph-based model versioning system: Architecture

Page 7: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 7

Example graph representation of a model

A

B: Int

<class>

A

ID1

<attribute>

B

<type>

Int

ID2 ID3

Kolovos, D.S., Di Ruscio, D., Pierantonio, A., Paige, R.F.: “Different models for model matching: An analysis of approaches to support model differencing” ICSE Workshop on Comparison and Versioning of Software Models (2009) 1-6

Page 8: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 8

Graph-based model versioning system: Architecture

Page 9: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 9

Graph-based model versioning system: Differences detection

M. F. van Amstel, M. G. J. van den Brand, Z. Protic, T. Verhoef:“Graph-based calculation and representation of metamodel-independent model differences”Submitted to FASE 2010

Page 10: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 10

Questions ?

Page 11: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 11

Graph Differences

Page 12: Version Control for Graphs as a Basis of Version Control for Models Z. Protić M. F. van Amstel M.G.J. van den Brand T. Verhoeff.

PAGE 12

Templating language

<pattern> ::= "TEMPLATE" <templatename> "(" <variablelist> ")" "->" "[" <variablelist> "]""uses" <templatelist> ":"<rulelist><templatename> ::= <string><templatelist> ::= | <templatename> | <templatename> "," <templatelist><variablelist> ::= | <variable> | <variable> "," <variablelist><rulelist> ::= <rule> | <rule> ";" <rulelist><rule> ::= <noderule> <setspecifier> | <edgerule> <setspecifier> | <matchrule> | <graphrule> | <emptyrule><graphrule> ::= <unionrule> | <intersectrule> | <subtractrule><emptyrule> ::= "empty(" <variable> ")"<noderule> ::= <term> | <hybrid><edgerule> ::= <term> | <hybrid> "," <term> | <hybrid> "," <term> | <hybrid><matchrule> ::= "[" <variablelist> "]" "=" "match(" <templatename> "(" <variablelist> ")" ")"<unionrule> ::= "[" <variablelist> "]" "=" "union(" "[" <variablelist> "]", "[" <variablelist> "]" ")"<intersectrule> ::= "[" <variablelist> "]" "=" "intersect(" "[" <variablelist> "]", "[" <variablelist> "]" ")"<subtractrule> ::= "[" <variablelist> "]" "=" "subtract(" "[" <variablelist> "]", "[" <variablelist> "]" ")"<setspecifier> ::= "{" <string> "}"<term> ::= <variable> | <constant><variable> ::= "$" <identifier><identifier> ::= <Acharacter> | <Acharacter> <string><constant> ::= <string><hybrid> ::= <term> <term> | <term> <hybrid><string> ::= <character> | <character> <string><character> ::= <acharacter> | <nchcracter> | <scharacter><acharacter> ::= "A"|"a"|...|"Z"|"z"<scharacter> ::= "_"|"="|":"<nchcracter> ::= "0"|"1"|...|"9"