Specification Flashcards
Specification
Written details about what a program is supposed to do, before that functionality is written.
Formal text in a structured document.
Focus on precise specification using mathematical notation.
Object Constraint Languages
OCL
Part of UML
Provides syntax for FOL used to annotate UML diagrams
First Order Logic
FOL
Express precisely express proposition, combine them with and or etc, and quantify them
Circularity
In the process of specifying thing, they may use the concept being defined in the definition “sort is defined by sorting”
3 Stages of FOL
Signature, Precondition, Postcondition
Signature in FOL
Gives the name of the program, the names and types of input arguments, and the name and type of the results.
Vector Y = SORT(Vector X)
Precondition in FOL
Specifications of must be true for us to enter the logic for a given signature
Postcondition in FOL
Says what must be true about the output produced by a function.
Expresses how the output is related to the input.
OCL
Object Constraint Language
Officially part of UML
Strongly typed and Declarative specification of system properties
What does OCL offer?
Constraints + Collection Classes + UML Diagram Navigation
Why do we need OCL?
UML diagrams are limited in what they can express.
Explain Structural relationships
Explain Behavior descriptions
They are a mechanism for specifying Precise Semantics
What does OCL extend UML with?
Class Invariants
Operation pre and post conditions
Guards on state-machine transitions
Is OCL declarative or procedural?
Declarative
Declarative Language
Pure expression
No assignment statements or side effects
Constraint
Formal assertion of system properties