This paper presents a new technique to automatically generate a diverse set of instantiations from a conceptual schema. It strengthens integrity constraints in a structured way to produce classifying terms that partition the solution space. A model finder then computes one instantiation from each equivalence class to maximize diversity. Future work includes prioritizing constraints, optimally selecting classifying terms, and evaluating on large case studies.
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
A Systematic Approach to Generate Diverse Instantiations for Conceptual Schemas
1. A Systematic Approach to Generate
Diverse Instantiations for Conceptual Schemas
Loli Burgueño, Jordi Cabot, Robert Clarisó, Martin Gogolla
ER’19
Salvador, Brazil, November 7th, 2019
2. Introduction
• typically require the creation of instantiations of the conceptual schema
• i.e., examples for an information base of a conceptual schema
• used as:
• Illustrations (for simulation, etc.)
• Counterexamples (describe invalid configurations, etc.)
• Test cases (to capture scenarios that should be checked, etc.)
2
Verification, validation and testing to ensure the
quality
of a conceptual schema
3. Motivation
• Cover a broad spectrum of different configurations and scenarios
• Otherwise, relevant corner cases might be missed
• causing faults and/or wrong conclusions
3
The set of instantiations should be diverse
4. Motivation
4
Model finders: Automatically compute (valid)
instantiations satisfying all constraints
• Domain expert who creates instantiations
manually?
very time-consuming and is usually not feasible
5. Motivation
5
While model finders automate the generation process,
they do not guarantee diverse solutions
• Domain expert who creates instantiations
manually?
very time-consuming and is usually not feasible
6. Our proposal
• New technique for generating test cases
(object models) for UML class models
• Guide construction process through classifying terms
• Classifying term:
• properties that can be used to partition the solution space
(OCL expressions on the class model)
6
7. Our proposal
• Classifying terms as a means of Equivalence Partitioning
• From each equivalence class one representative
object model is chosen
• Test cases significantly different with w.r.t. classifying
term
7
8. Classifying Terms
8
-- CT hasChildren:
Person.allInstances->forAll( p |
p.child->isEmpty())
Two equivalence classes!
hasChildren=True
hasChildren=False
Model space
9. Classifying Terms
9
Four equivalence classes!
-- CT yearBDefined:
Person.allInstances->forAll( p |
p.yearB.oclIsUndefined())
-- CT hasChildren:
Person.allInstances->forAll( p |
p.child->isEmpty())
Model space
hasChildren=F
yearBDefined=F
hasChildren=T
yearBDefined=T
hasChildren=F
yearBDefined=T
hasChildren=T
yearBDefined=F
10. Classifying Terms
• Tool context:
USE & its model
validator
• Example:
wGp withGrandparent
w2c with2children
w2p with2parents
10
11. Our Proposal
We observed that classifying terms are typically related to the
integrity constraints in the schema
If we mutate the schema's integrity constraints in a structured
way, we can automatically generate classifying terms
11
Proposing suitable classifying
terms requires domain knowledge
12. Our Proposal
Mutation = Strengthening of integrity constraints (OCL)
i.e., generation of a more restrictive version
Strengthening – Example:
expL or expR expL and expR
12
exp exp+
exp
exp+
13. Mutation = Strengthening of integrity constraints (OCL)
i.e., generation of a more restrictive version
Strengthening – Further examples of mutation operations:
Our Proposal
13
14. Our Proposal
• Meaningful CTs
• border cases become clear
• For example, one instantiation where a particular constraint holds and
another one where the same constraint fails
14
17. • USE tool (1)
• Implemented in Java
• GUI
• packages to load, modify
and inspect models and
instantiations
• commands to invoke the
KodKod relational solver
for model finding
Tool Support
17
(1) https://sourceforge.net/projects/useocl/
18. • Process:
1. Candidate generation:
a. Each OCL integrity constraint is strengthen by means of a post-order traversal of
its AST
b. For each expression in the AST, we generate the candidate strengthenings by
combining the strengthenings of its subexpressions
2. Candidate selection:
a. Can be performed in different ways: randomly; using heuristics or with the help of
a domain expert
3. Computation of instantiations:
a. we provide the CTs to the model finder
b. it finds one instantiation in each of the equivalence classes induced by the
partition
Process
18
• Input: a UML class diagram annotated with OCL
invariants (.use file)
19. 19
Discussion
• Performance
• In the generation of the CTs, it is negligible (151 ms for running example)
• Computing the instantiation is always a bottleneck but we significantly
reduce number of times we trigger the generation improving the
overall computing time
• Correctness and completeness
• Any object model satisfies all constraints
• Support for all OCL 2.4 except for ordered collections and recursively defined queries
• Generation of boolean CTs. Integer CTs in the future
20. Discussion
• Combination strategies for classifying terms
• We could change the way in which the equivalent
classes are traversed in the solution generation
process
• For instance:
1. focus first on one CT alone and generate diverse examples
(i.e. emphasizing local diversity )
2. combine all classifying terms and generate solutions that
explore equivalent classes taking into account the value of
different classifying terms at the same time (i.e.
emphasizing global diversity )
20
21. New approach to enforce the generation of a diverse set of
instantiations from a given conceptual schema
Conclusions & Future work
21
• Prioritize constraints which are potentially more useful
• Definition of strategies to optimally select and combine different CTs
and guide the exploration of model solutions for each combination.
• Large case studies
22. A Systematic Approach to Generate
Diverse Instantiations for Conceptual Schemas
Loli Burgueño, Jordi Cabot, Robert Clarisó, Martin Gogolla
ER’19
Salvador, Brazil, November 7th, 2019