Techniques For The: Unambiguous Specification of Software
Techniques For The: Unambiguous Specification of Software
1
Specification in the software
process Specification and design
• Specification and design are Requirements
Requirements
intermingled. Definition
Definition
2
Development costs with formal specification
Interface specification
Validation • Large systems are decomposed into
Validation
subsystems with well-defined interfaces
Design &
Implementation
between these subsystems
Design & • Specification of subsystem interfaces
Implementation
allows independent development of the
Cost
different subsystems
Specification
Systematic algebraic
Specification components
specification
• Introduction • Algebraic specifications of a system
– Defines the sort (the type name) and may be developed in a systematic
declares other specifications that are used
• Description way
– Informally describes the operations on the – Specification structuring.
type – Specification naming.
• Signature
– Operation selection.
– Defines the syntax of the operations in the
interface and their parameters – Informal operation specification
• Axioms – Syntax definition
– Defines the operation semantics by defining – Axiom definition
axioms which characterise behaviour
3
Interface specification in critical
Specification operations systems
• Constructor operations. Operations • Consider an air traffic control system
where aircraft fly through managed
which create entities of the type
sectors of airspace
being specified • Each sector may include a number of
• Inspection operations. Operations aircraft but, for safety reasons, these
which evaluate entities of the type must be separated
being specified • In this example, a simple vertical
separation of 300m is proposed
• To specify behaviour, define the • The system should warn the controller if
inspector operations for each aircraft are instructed to move so that
constructor operation the separation rule is breached
Specification commentary
SECTOR
Sector sort Sector
imports INTEGER, BOOLEAN
specification Enter - adds an aircraft to the sector if safety conditions are satisfed
Leave - removes an aircraft from the sector
Move - moves an aircraft from one height to another if safe to do so
Lookup - Finds the height of an aircraft in the sector
Create → Sector
Put (Sector, Call-sign, Height) → Sector
In-space (Sector, Call-sign) → Boolean
definitions
Leave (Put (S, CS1, H1), CS) =
if CS = CS1 then S else Put (Leave (S, CS), CS1, H1)