Two Basic Correctness Properties for ATL Transformations: Executability and Coverage (MtATL 2011)
-
Upload
elena-planas -
Category
Technology
-
view
336 -
download
0
Transcript of Two Basic Correctness Properties for ATL Transformations: Executability and Coverage (MtATL 2011)
Two Basic Correctness Properties for Transformations:
Executability and Coverage
Elena PlanasJordi Cabot
Cristina Gómez
Universitat Oberta de Catalunya (Spain)École des Mines de Nantes – INRIA (France)Universitat Politècnica de Catalunya (Spain)
MtATL 2011: 3rd International Workshop on Model Transformation with ATLJuly 1st, 2011 - Zürich, Switzerland
model transformations play a key role with the emergence of MDE.
the quality of the transformation process depends on the quality of the model transformations.
Related work
tools
analysis
testinglightweigh
t verificatio
n1/20
Define two basic correctness properties of model transformations rulesPropose a method to check these properties
goal
Lightweight (efficient) verification method Feedback suggesting possible corrections
method features
matched rules (declarative rules)focus
2/20
Property #1:
weak executability of an rule
3/20
An rule is weakly executable if it has a chance of being successfully executed (the rule’s execution generates a target model consistent with the target metamodel integrity constraints).Source
MetaModel
Target MetaMod
el
rule
Conf
orm
s To
Conf
orm
s To
4/20
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
rule
Person
name: Stringage: IntegercollegeName: String
**
Knows
{Sym}
PersonMM
Student
name: StringSubject* IsEnrolledIn 1..*
id: String
College
name: String* StudiesAt 1
StudentMM
name: Erikage: 21collegeName: UOC
name: Erik
name: UOC
Studie
sAt
NOT
Con
form
s To
Conf
orm
s To
5/20
A
dependency
6/20
from an update up1 to another update up2 expresses that up2 must be included in all rules where up1 appears to avoid violating the metamodel constraints.
A
dependency
6/20
A
dependency
Create a new object… to o: TargetMM!A …
Initialize its mandatory attributes… to o: TargetMM!A( attrA value) …
Create its mandatory links… to o: TargetMM!A( b obj) …
Every time we… we must… … and…
TargetMM
B* 1
attrB: Type
A
attrA: Type
6/20
Compute dependencies
Mapdependencies
1
All dependenciesmapped?
2
rule
ruleis weakly executable
ruleis not weakly executable
FEEDBACK
no yes
7/20
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
Compute dependencies
Mapdependencies
1
All dependenciesmapped?
2
rule
is weakly executable
ruleis not weakly executable
FEEDBACK
no yes
rule
Subject* IsEnrolledIn 1..*
id: String
College
name: String* StudiesAt 1
Student
name: String
rule
Create a new Student requires:Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
Dependencies
8/20
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
ruleis weakly executable
ruleis not weakly executable
FEEDBACK
no yes
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
ruleis weakly executable
ruleis not weakly executable
FEEDBACK
no yes
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
ruleis weakly executable
ruleis not weakly executable
FEEDBACK
no yes
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
ruleis weakly executable
ruleis not weakly executable
FEEDBACK
no yes
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
ruleis weakly executable
ruleis not weakly executable
FEEDBACK
no yes
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
ruleis not weakly executable
FEEDBACK
no
ruleis weakly executable
yes
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
is not Weakly Executable
rule Person2Student
ERROR:
Compute dependencies
Mapdependencies
1
2
rule
All dependenciesmapped?
DependenciesCreate a new Student requires:
Initialize its name attributeCreate 1 link of StudiesAt associationCreate at least 1 link of IsEnrolledIn association
Create a new College requires:Initialize its name attribute
rule
ruleis not weakly executable
FEEDBACK
no
ruleis weakly executable
yes
AD
D F
EED
BA
CK
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name college c ), c: StudentMM!College ( name p.collegeName )}
9/20
is not Weakly Executable
rule Person2Student
ERROR:
Property #2:
coverage of an rule set
10/20
A set of rules is
covering if it allows addressing all elements of the source and target metamodels.
source perspective
source-coverage
target perspective
target-coverage
11/20
A set of rules is source-covering when all elements of the source metamodel may be navigated throught the execution of these rules.
…is not source-covering (warning)
rule’s set
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name, college c ), c: StudentMM!College ( name p.collegeName )}
Person
name: Stringage: IntegercollegeName: String
**
Knows
{Sym}
PersonMM
12/20
A set of rules is target-covering when all elements of the target metamodel may be created or initialized throught the execution of these rules.rule’s set
rule Person2Student { from p: PersonMM!Person to s: StudentMM!Student ( name p.name, college c ), c: StudentMM!College ( name p.collegeName )}
Student
name: StringSubject* IsEnrolledIn 1..*
id: String
College
name: String* StudiesAt 1
StudentMM
…is not target-covering (warning) 13/20
Compute metamodel
elementsrule setFEEDBACK
Compute addressedelements
Compute non-addressed
elements
1 2 3
14/20
Compute metamodel
elementsrule setFEEDBACK
Compute addressedelements
Compute non-addressed
elements
1 2 3
14/20
Compute metamodel
elementsrule setFEEDBACK
Compute addressedelements
Compute non-addressed
elements
1 2 3
15/20
Person classname attribute (of Person)age attribute (of Person)collegeName attribute (of Person)Knows association
Student classname attribute (of Student)College classname attribute (of College)Subject classid attribute (of Subject)StudiesAt associationIsEnrolledIn association
Compute metamodel
elementsrule setFEEDBACK
Compute addressedelements
Compute non-addressed
elements
1 2 3
16/20
Person classname attribute (of Person)age attribute (of Person)collegeName attribute (of Person)Knows association
Student classname attribute (of Student)College classname attribute (of College)Subject classid attribute (of Subject)StudiesAt associationIsEnrolledIn association
Is navigated?
Is created/initialized?
17/20
Compute metamodel
elementsrule setFEEDBACK
Compute addressedelements
Compute non-addressed
elements
1 2 3
Non-addressed
Non-addressed
Non-addressed
Non-addressed
Non-addressed
rule setis not sourcecovering
WARNING:
is not targetcovering
rule setWARNING:
Is navigated?
Is created/initialized?
Person classname attribute (of Person)age attribute (of Person)collegeName attribute (of Person)Knows association
Student classname attribute (of Student)College classname attribute (of College)Subject classid attribute (of Subject)StudiesAt associationIsEnrolledIn association
Conclusions:
feedback
18/20
Further work:
weak executability coverage
feedbackAddress new correctness properties
Provide tool support
Address other types of rules 19/20