Harmony: An Approach and Tool for Combining Semi-formal and Formal Notations in Software...
description
Transcript of Harmony: An Approach and Tool for Combining Semi-formal and Formal Notations in Software...
1 / 28
Harmony: An Approach and Tool for Harmony: An Approach and Tool for Combining Semi-formal and Formal Combining Semi-formal and Formal Notations in Software SpecificationNotations in Software Specification
CS 791z Topics on Software Engineering
Instructor’s Research
April 19, 2004
2 / 28
Outline
Context A Procedural Frame The Harmony Tool Conclusions
3 / 28
Context: The Harmony Project
Proposal of an approach for specifying time- constrained systems (TCS) based on the combined use of UML (graphical, semi-formal notation) and Z++ (formal notation)
Topic placed at the confluence of three paradigms: object-orientation formal specification visual representation
4 / 28
Context: Why Integrate?
Combine benefitsGraphical notations easy to useFormal methods precise
Different aspects of the system need different ways of description
Provide choices
5 / 28
Context: Research Space and Location
RTnonRT
formal
non OO OO
Z
Topic location: * formal, employing an OOZ variant
* OO development, UML-based* RT modelling capability
UML
formal
OOZ
6 / 28
Strategies for Integration
Integration of notations: Semi-formal/Formal Semi-formal/Semi-formal Formal/Formal
Types of semi-formal/formal integrations: Derivation or (simple) formalization Complementary formalization Tight integration, involving two-way translations
7 / 28
Related WorkRelated Work
Similar approaches:Similar approaches: Jia’s AMLJia’s AML Noe and Hartrum’s extension of Rational Rose Noe and Hartrum’s extension of Rational Rose France et al.’s blending of Octopus and Z France et al.’s blending of Octopus and Z Headway System’s RoZeLink Headway System’s RoZeLink Kim and Carrington’s UML/Object-Z combinationKim and Carrington’s UML/Object-Z combination
Our approach is distinct from all the above in at Our approach is distinct from all the above in at least one major aspect: variant of Z involved, least one major aspect: variant of Z involved, provisions for dealing with RTS, tight integration provisions for dealing with RTS, tight integration of notations, or type of supporting environmentof notations, or type of supporting environment
8 / 28
Notations: Notations: UMLUML
“Graphical language for visualizing, specifying, constructing, and documenting the artifacts of software-intensive systems” [G. Booch]
OMG standard notation for object modeling Includes structural & behavioral model elements Extension mechanisms: stereotypes, tagged values,
constraints Support for RTS: events, signals, active classes, finite-
state machines, timing marks and expressions However, for rigorous development supplementary
formalization is necessary
9 / 28
Notations: Notations: UML - Example of Class Diagram
Elevator
PositionDetector1
1
Door
1 1
CarButton
1
*
SpecialCarButton
1
*
Button
FloorButton Floor10..1
10..1
GroupIndicator
1
1
Indicator
1*
1
1serves
AlarmSystem11
10 / 28
Notations: Notations: UML - Example of State Diagram
stoppedToDownentry: door.open()activity: updateRequests()exit: door.close()
movingUpentry: moveUp()activity: goToTarget()exit: stop()
stoppedToUpentry: door.open()
activity: updateRequests()exit: door.close()
idleactivity: updateRequests()
movingDownentry: moveDown()activity: goToTarget()exit: stop()
when(other_level_requestand up_to_go)
when(target_reachedand up_to_go)
when(up_target)
when(no_requests)
when(level_request and up_to_go)
when(level_request and down_to_go)
when(target_reachedand up_to_go)
when(target_reachedand down_to_go)
when(down_target)
when(no_requests)
when(other_level_requestand down_to_go)
when(target_reached anddown_to_go)
11 / 28
Notations: Notations: Z++
Created by Lano and Haughton Essentially, extends Z with the class construct Closer to implementation than other formal languages Support for dealing with time in the HISTORY clause:
Temporal Logic or Real-Time Logic (RTL) formulae
12 / 28
Notations: Z++ Class
ZPP_Class ::= CLASS Identifier [TypeParams] [EXTENDS Ancestors]
[TYPES TypeDefs][FUNCTIONS AxiomaticDefs][OWNS Locals][RETURNS OpTypes][OPERATIONS OpTypes][INVARIANT Predicate][ACTIONS Actions][HISTORY History]END CLASS
13 / 28
Translations UML/Z++: Overview
Formalization = UML to Z++ translationFormalization = UML to Z++ translation Deformalization = Z++ to UML translationDeformalization = Z++ to UML translation Algorithms for automated translations have been Algorithms for automated translations have been
proposedproposed Formalization of both structure and behavior Formalization of both structure and behavior
Rules and principles for translating class diagrams Rules and principles for translating class diagrams (algorithm AFCD)(algorithm AFCD)
Rules and principles for translating state diagrams Rules and principles for translating state diagrams (AFSD)(AFSD)
Principles for reverse translation (ADF)Principles for reverse translation (ADF)
14 / 28
A Procedural Frame
Series of activities in which model artifacts are produced
Subset of UML used (“2+1 views”) Artifacts:
UML elements: use case diagrams, scenarios, sequence diagrams, class diagrams, and class compounds
Z++ specifications: Z++ classes and statements Activities organized in stages
‘Regular’ and ‘irregular’ sequences of activities
15 / 28
A A Procedural Procedural
FrameFrame
Requirements Set
UC Collection
SC Collection
1 Definition ofUse Cases
2 Elaboration ofScenarios
3A Construction ofClass Diagrams
4A Elaboration of UMLClass Compounds
4B Elaboration ofZ++ Specification
5AFormalization
5BDeformalization
UML ClassCompounds(COMP)
(CLS and CLSTD)
Z++ Specification(ZSPEC), a set of
Z++ classes (ZPPC)
Integrated UML/Z++Classes Collection
3B Specification ofSequence Diagrams
SQD CollectionCD Collection
16 / 28
Regular Flow Regular Flow of Activitiesof Activities
1
2
3A
4A
5A
4B
3B
5B
Stage 1
Stage 2
Stage 3
Stage 4
Stage 5
Definition ofUse Cases
Elaborationof Scenarios
Construction ofClass Diagrams
Specificationof Sequence
Diagrams
Elaboration of UMLClass Compounds
Elaboration ofZ++
Specification
Formalization(UML to Z++)
Deformalization(Z++ to UML)
17 / 28
Irregular Flow Irregular Flow of Activitiesof Activities
1
2
3A
4A
5A
4B
3B
5B
Stage 1
Stage 2
Stage 3
Stage 4
Stage 5
Definition ofUse Cases
Elaborationof Scenarios
Construction ofClass Diagrams
Specification ofSequenceDiagrams
Elaboration of UMLClassCompounds
Elaboration ofZ++ Specification
Formalization(UML to Z++)
Deformalization(Z++ to UML)
18 / 28
The Harmony Tool: Characteristics
Sustains the development of combined UML/Z++ models
Operates on specification projects Monolithic construction Options for automated translations Support for class compounds Tandem mode of operation Provisions for interfacing with external tools
19 / 28
Harmony: The Browser
20 / 28
Harmony: Project Pane
21 / 28
Harmony: New Element Selector & Legend Pane
22 / 28
Harmony: Toolboxes
23 / 28
Harmony: Project Loaded
24 / 28
Harmony: UML Space (Class Diagram)
+updateRequests()+updateTarget()+goToTarget()+moveUp()+moveDown()+stop()
#state : ElevatorState#dir : Direction#current : unsigned int#target : unsigned int#carRequests : unsigned int [ ]#upFloorRequests : unsigned int [ ]#downFloorRequests : unsigned int [ ]
Elevator
+getCurrentFloor() : unsigned int+calculateSpeed() : double
-currentFloor : unsigned int
PositionDetector
1
1
+open()+close()+getState() : DoorState
#state : DoorState
Door
1 1
+getButtonNumber() : unsigned int-buttonNumber : unsigned int
CarButton
1
*
+getKind() : SpecialCarButtonKind-kind : SpecialCarButtonKind
SpecialCarButton
1*
+press()+turnOff()+getState() : ButtonState
#state : ButtonState
Button
+getKind() : FloorButtonKind-kind : FloorButtonKind
FloorButton +getKind() : FloorKind+setFloorNumber(in floorNumber : unsigned int)+getUpButtonState() : ButtonState+getDownButtonState() : ButtonState
#kind : FloorKind#floorNumber : unsigned int#upButton : FloorButton#downButton : FloorButton
Floor
10..1
10..1
+setIndicator(in ind : unsigned int)+resetIndicator(in ind : unsigned int)+resetAll()
-size : unsigned int
GroupIndicator
11
+turnOn()+turnOff()+getState() : IndicatorState
#state : IndicatorState#indicatorNumber : unsigned int
Indicator
1*
11
serves
+audioSignal()+visualSignal()
AlarmSystem1
1
1
*
25 / 28
Harmony: Z++ Space (Class Spec)
26 / 28
Harmony: Harmony: Z++ Space (Timing Constraints)Z++ Space (Timing Constraints)
27 / 28
Conclusions: Summary
Pragmatic semi-formal/formal combination of notations
Formalization of UML constructs in Z++ Rigorous treatment of TCS via RTL Detailed design of the Harmony ISE Lightweight, rapid modeling process
28 / 28
Conclusions: Future Work (most on Andy )
Enhancement of algorithmsEnhancement of algorithms Refinement of the tool’s functionalityRefinement of the tool’s functionality Implementation of Harmony Implementation of Harmony Syntax checker for Z++Syntax checker for Z++ More applicationsMore applications