On the verification of UML/OCL
class diagrams using constraint
programming
Jordi Cabot (jordi.cabot@inria.fr)
Robert Clarisó (rclariso@uoc.edu)
Daniel Riera (drierat@uoc.edu)
1
On the verification of UML/OCL class diagrams using constraint programming
1. The context: Model-driven software engineering
2. The problem: Quality assurance using formal methods
3. Our proposal: Verification using constraint programming
Index
2
On the verification of UML/OCL class diagrams using constraint programming
1. The context: Models in SW Engineering
3
Modeling in engineering
4
Features that are not
relevant to the purpose of
the model are excluded
Benefits
• Simplicity
• Understandability
• Reusability
“A model is a description or
specification of a system
defined for a specific purpose”
Software models: perspectives
5
Information base
(UML class diagram)
Variability among products
(Feature model)
Behavior and data flow
(UML activity diagram)
Documentation and communication
“Describe how the system will work”
Reverse engineering
“Guide the implementation”
Code generation
Simulation
Verification and validation
“Analyze if the model is correct”
Domain-Specific Languages
Software models: applications
6
2. The problem: Quality assurance
7
Defects in software models
Complete
Includes all relevant info
Precise
Describes system accurately
Suitable
Useful to stakeholders
Validation
“Is it the right product?”
Verification
“Is the product right?”
Well-formed
Correct syntax
Consistent
No contradictions
Non-redundant
Lack of duplicities
BA
A
1
2
A B
C
8
Model-based formal verification
VERIFICATION TOOL
?
Model
A B
C
Correctness
Property
Additional
Parameters
Designer
Formal Notation
x:y: p(x,y)
Feedback Yes / No
Formal proof
Example / Counterexample
Reasoning Engine
9
Trade-offs in verification
Verification
Automation
Is user intervention required?
Efficiency
Required memory and CPU
Expressiveness
Type of supported properties
OCL invariants?
Precision / coverage
Undetected errors?
False alarms?
10
3. Our proposal: Constraint programming
11
Constraint Satisfaction Problems
12
Variables
Domains
that should have a value
Define a problem declaratively in terms of...
Constraints
set of potential values
restrictions on the legal values
Then, let a solver find the solution (if any).
Example: N-Queens Problem
Our proposal: UMLtoCSP
UMLtoCSP
?
Model
A B
C
Correctness
Property
Finite
Bounds
Designer
Formal Notation
CSP
Feedback
Example or ?
Counterexample or ?
Reasoning Engine
13
2. The designer needs to select suitable bounds
– Small enough to allow efficient analysis
– Large enough to provide confidence in the result
1. Answer may be inconclusive
– There may be no (counter)example within the bounds
– No assurance of what happens outside the bounds
Cons
Pros 1. Automatic analysis of expressive models (including OCL)
2. Efficient solvers available
– Execution time can be controled by tuning bounds
3. Useful feedback (when it is available)
14
Strengths and weaknesses
Thanks for your attention!
Further details
http://gres.uoc.edu/UMLtoCSPUMLtoCSP homepage
Full paper
Contact Robert Clarisó (rclariso@uoc.edu)
Jordi Cabot, Robert Clarisó, Daniel Riera.
On the verification of UML/OCL class diagrams
using constraint programming.
Journal of Systems and Software 93: 1-23 (2014)
Acknowledgements
EIMT.UOC.EDU
GRES-UOC @ IN3
GMC @ UPC
15

On the verification of UML/OCL class diagrams using constraint programming

  • 1.
    On the verificationof UML/OCL class diagrams using constraint programming Jordi Cabot (jordi.cabot@inria.fr) Robert Clarisó (rclariso@uoc.edu) Daniel Riera (drierat@uoc.edu) 1 On the verification of UML/OCL class diagrams using constraint programming
  • 2.
    1. The context:Model-driven software engineering 2. The problem: Quality assurance using formal methods 3. Our proposal: Verification using constraint programming Index 2 On the verification of UML/OCL class diagrams using constraint programming
  • 3.
    1. The context:Models in SW Engineering 3
  • 4.
    Modeling in engineering 4 Featuresthat are not relevant to the purpose of the model are excluded Benefits • Simplicity • Understandability • Reusability “A model is a description or specification of a system defined for a specific purpose”
  • 5.
    Software models: perspectives 5 Informationbase (UML class diagram) Variability among products (Feature model) Behavior and data flow (UML activity diagram)
  • 6.
    Documentation and communication “Describehow the system will work” Reverse engineering “Guide the implementation” Code generation Simulation Verification and validation “Analyze if the model is correct” Domain-Specific Languages Software models: applications 6
  • 7.
    2. The problem:Quality assurance 7
  • 8.
    Defects in softwaremodels Complete Includes all relevant info Precise Describes system accurately Suitable Useful to stakeholders Validation “Is it the right product?” Verification “Is the product right?” Well-formed Correct syntax Consistent No contradictions Non-redundant Lack of duplicities BA A 1 2 A B C 8
  • 9.
    Model-based formal verification VERIFICATIONTOOL ? Model A B C Correctness Property Additional Parameters Designer Formal Notation x:y: p(x,y) Feedback Yes / No Formal proof Example / Counterexample Reasoning Engine 9
  • 10.
    Trade-offs in verification Verification Automation Isuser intervention required? Efficiency Required memory and CPU Expressiveness Type of supported properties OCL invariants? Precision / coverage Undetected errors? False alarms? 10
  • 11.
    3. Our proposal:Constraint programming 11
  • 12.
    Constraint Satisfaction Problems 12 Variables Domains thatshould have a value Define a problem declaratively in terms of... Constraints set of potential values restrictions on the legal values Then, let a solver find the solution (if any). Example: N-Queens Problem
  • 13.
    Our proposal: UMLtoCSP UMLtoCSP ? Model AB C Correctness Property Finite Bounds Designer Formal Notation CSP Feedback Example or ? Counterexample or ? Reasoning Engine 13
  • 14.
    2. The designerneeds to select suitable bounds – Small enough to allow efficient analysis – Large enough to provide confidence in the result 1. Answer may be inconclusive – There may be no (counter)example within the bounds – No assurance of what happens outside the bounds Cons Pros 1. Automatic analysis of expressive models (including OCL) 2. Efficient solvers available – Execution time can be controled by tuning bounds 3. Useful feedback (when it is available) 14 Strengths and weaknesses
  • 15.
    Thanks for yourattention! Further details http://gres.uoc.edu/UMLtoCSPUMLtoCSP homepage Full paper Contact Robert Clarisó (rclariso@uoc.edu) Jordi Cabot, Robert Clarisó, Daniel Riera. On the verification of UML/OCL class diagrams using constraint programming. Journal of Systems and Software 93: 1-23 (2014) Acknowledgements EIMT.UOC.EDU GRES-UOC @ IN3 GMC @ UPC 15