This document discusses assisting domain modeling with formal analysis. It summarizes that domain models describe entities and relationships in a system. Typical domain modeling results in an incorrect raw modeling space. Precise domain modeling uses constraints like OCL to limit solutions and find the precise modeling space. The document presents an example of feature model metamodeling and constraints. It describes challenges with the Pramana tool for exploring modeling spaces. Finally, it discusses understanding OCL usage patterns, automatically deriving invariants from patterns, and potential algorithms for mining patterns.
A Systematic Approach to Generate Diverse Instantiations for Conceptual Schemas
Point GEODES
1. Assisting Domain Modeling
with Formal Analysis
Juan Cadavid
Benoit Baudry
Jean-Marc Jézéquel
INRIA Bretagne - Atlantique, team Triskell
1
2. Domain Models
• A conceptual
model of a
system which
describes the
various
entities
involved in that
system and their
relationships.
Domain Model for Insurance
2
3. Typical Domain
Modeling
Domain Model
Raw Modeling Space
3
4. Typical Domain
Modeling
Incorrect
Instances
There is an intention not expressed
by the metamodel on its own.
4
5. Precise Domain
Modeling
Limit the
number of
solutions to find
the precise
modeling space
5
6. Precise Domain
Modeling
OCL
• Write constraints
along with the
domain model.
OCL
OCL
• The most popular
language is OCL
OCL (Object Constraint
OCL
Language)
6
12. Example: Metamodeling
Feature Models
A
B
The or operator
must have at least
two operands
9
13. Precise Domain
Modeling
• A given set of
OCL
constraints could
include bad
instances, and leave
OCL out good instances.
OCL
• How to find the
good set of
OCL
OCL constraints that
correctly
describes the
modeling space?
10
14. Exploring the Modeling
Space: Generating Instances
Kermeta2Alloy
Metamodel Metamodel
in Ecore in Alloy
Pramana:
Generates
conforms to AlloySolution
Metamodel
Instances using Solution2xmi Instances
Instances
Alloy in XMI
in Alloy
XML
11
16. Challenges with
Pramana
• Robustness/Enough testing
• Alloy limitations
• Small scope
• Integer numbers
• Maximize distance between metamodel
instances
• OCL2Alloy: A difficult transformation
13
17. Understanding the use
of OCL (1)
• Study of 519 invariants from three OMG
specifications: UML, OCL and CORBA
Component Model
• Definition of Metrics
• Size of Metamodel
• Invariant complexity w.r.t. the metamodel
• Invariant complexity w.r.t to OCL
14
18. Understanding the use
of OCL (1I)
• 88% of invariants were written with 36%
of the OCL language.
• Most invariants are defined over two or
less domain elements (i.e. class
attributes)
• Result: Catalog of recurring patterns in
OCL invariants.
15
19. Automatic Invariant
Derivation (I)
• Prototype to match patterns from Catalog
• Input: Metamodel, correct instances and incorrect
instances.
• Matching instances marked as incorrect by the user
• Incorrect motifs
• Derive OCL invariant from template
• Test derived instances marked as correct by the
user
16