Specification Flashcards

1
Q

Specification

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Object Constraint Languages

A

OCL
Part of UML
Provides syntax for FOL used to annotate UML diagrams

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

First Order Logic

A

FOL

Express precisely express proposition, combine them with and or etc, and quantify them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Circularity

A

In the process of specifying thing, they may use the concept being defined in the definition “sort is defined by sorting”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

3 Stages of FOL

A

Signature, Precondition, Postcondition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Signature in FOL

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Precondition in FOL

A

Specifications of must be true for us to enter the logic for a given signature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Postcondition in FOL

A

Says what must be true about the output produced by a function.
Expresses how the output is related to the input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

OCL

A

Object Constraint Language
Officially part of UML
Strongly typed and Declarative specification of system properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does OCL offer?

A

Constraints + Collection Classes + UML Diagram Navigation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why do we need OCL?

A

UML diagrams are limited in what they can express.
Explain Structural relationships
Explain Behavior descriptions

They are a mechanism for specifying Precise Semantics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does OCL extend UML with?

A

Class Invariants
Operation pre and post conditions
Guards on state-machine transitions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Is OCL declarative or procedural?

A

Declarative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Declarative Language

A

Pure expression

No assignment statements or side effects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Constraint

A

Formal assertion of system properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Uses of OCL

A
Specify Invariants
Describe Pre and Post Conditions
Specify Derivation Rules
Describe Guards
Specify Targets
Specify Type Invariants
Query Language
17
Q

OCL Syntax

A

context :

eg
context LargeCompany
inv: numberOfEmployees > 50

18
Q

Types of Constraints in OCL

A

Invariants, Precondition, Postcondition

19
Q

Invariant

A

A statement of a property that is always true.
Express key system requirement.

uses inv keyword

20
Q

OCL Let Clause

A

Introduces an identifier which has the value of an expression. This is to be used in a constraint