Top Banner
1 A UML Class Diagram Analyzer Tiago Massoni Rohit Gheyi Paulo Borba Software Productivity Group Informatics Center – UFPE October 2004
22

A UML Class Diagram Analyzer

Jan 21, 2016

Download

Documents

ulema

A UML Class Diagram Analyzer. Tiago Massoni Rohit Gheyi Paulo Borba. Software Productivity Group Informatics Center – UFPE October 2004. UML and Critical Systems. UML Growing interest Explore concepts Address important problems OCL to specify complex constraints - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A UML Class Diagram Analyzer

1

A UML Class Diagram Analyzer

Tiago Massoni

Rohit Gheyi

Paulo Borba

Software Productivity Group

Informatics Center – UFPE

October 2004

Page 2: A UML Class Diagram Analyzer

2

UML and Critical Systems

UML Growing interest Explore concepts Address important problems OCL to specify complex constraints

Complex structures with class diagrams

Page 3: A UML Class Diagram Analyzer

3

UML/OCL and Tools

Lack of semantics Some have proposed approaches Did not stimulate tools for automatic

analysis

Absence of tool support Additional trouble in critical systems Structural modeling errors are hard to

detect

Page 4: A UML Class Diagram Analyzer

4

Subtle Errors when Modeling Critical Systems

Structural errors OCL invariants may turn a class diagram

over-constrained or inconsistent Under-constrained diagrams allow

incorrect implementations

These problems are desirable to be automatically detected…

Page 5: A UML Class Diagram Analyzer

5

Contributions

Approach for automatic analysis of UML class diagrams A precise semantics for class diagrams is given

Semantic model: Alloy Object modeling language Analysis tool for concrete feedback Modeled several critical systems

Page 6: A UML Class Diagram Analyzer

6

Contributions

Semantics by mapping Mapping rules from diagrammatic and

OCL class invariants to Alloy

We leverage automatic analysis of Alloy to class diagrams Automatic generation of snapshots Assertion checking

Page 7: A UML Class Diagram Analyzer

7

Outline

Alloy Semantics for UML class diagrams Example Alloy in Critical Systems

Page 8: A UML Class Diagram Analyzer

8

Alloy

MIT – Software Design Group (Daniel Jackson)

Simple language for declarative modeling Primarily structural properties Sets, relations and predicate logic

Alloy Analyzer

Page 9: A UML Class Diagram Analyzer

9

UML to Alloy

fact BankProperties { Account = ChAcc all a:Account|lone a.~accs bk = ~accs}sig Bank { accs: set Account}sig Account{ bk: set Bank}sig ChAcc extends Account {}

Page 10: A UML Class Diagram Analyzer

10

Semantics for Class Diagrams

Initial focus on structural properties Avoided constructs with undefined

semantics Diagrammatic constructs

Classes and interfaces: signatures Binary associations and attributes:

relations Generalization: extends

Page 11: A UML Class Diagram Analyzer

11

Semantics for Class Diagrams

OCL invariants: Alloy facts Universally quantified on self

OCL Alloy

X.oclIsTypeOf(Y) X in Y

X.allInstances X

X->isEmpty() no X

X->forAll(a|P) all a:X| P

X->size() #X

Page 12: A UML Class Diagram Analyzer

12

Analysis Example

Page 13: A UML Class Diagram Analyzer

13

Analysis ExampleSnapshot 1 : scope of two

Customers and their personal accounts aren’t related at all (they could be in different banks)

Page 14: A UML Class Diagram Analyzer

14

Analysis Example

Changing the

diagram

Snapshot 2

(still under-constrained)

Page 15: A UML Class Diagram Analyzer

15

Analysis Example

Adding an OCL constraint:

Snapshot 3

(great!)

context Bank inv customersAccountsInBank:self.custs.owned_accs->includes(self.accs)

Page 16: A UML Class Diagram Analyzer

16

Analysis Example I’d like to check whether every customer with cards has an

account Within the Customer context:

self.card->notEmpty() implies self.owned_accs->notEmpty()

Counterexample:

Page 17: A UML Class Diagram Analyzer

17

Applications of Alloy in Critical Systems

Radiation Therapy Machine Operation Commutativity

Railway System Access Control Air-traffic control

Page 18: A UML Class Diagram Analyzer

18

Conclusion Visual identification of modeling problems Covering many more states than any testing

tool Leverage the benefits to UML Class

Diagrams Future Work

Prototype (translation, analysis) Behavioral Modeling Case studies Denotational semantics for class diagrams Equivalence notion for models

Page 19: A UML Class Diagram Analyzer

19

Software Productivity Group

www.cin.ufpe.br/spg Model refactoring Synchronization model-source code Semantics Formal Methods

Page 20: A UML Class Diagram Analyzer

20

Putting Analysis to Work

UML class diagram

semanticmapping

Alloy model

Alloy Analyzer(SAT Solver)

Snapshot or counterexample

UML object diagrams

translation

Page 21: A UML Class Diagram Analyzer

21

Alloy Analyzer

Two kinds of analysis Simulation Assertion checking

Analysis Bounded by a scope of objects and

relations

Page 22: A UML Class Diagram Analyzer

22

A UML Class Diagram Analyzer

Tiago Massoni

Rohit Gheyi

Paulo Borba

Software Productivity Group

Informatics Center – UFPE

October 2004