Professional Documents
Culture Documents
1
Background - Problems in Software Development
Specification Program
Construct
S P
What to do How to do it
3
Background - Problems in Software Development
A better way to write the same specification:
“A software system for an ATM needs to provide services
◼ Can be ambiguous
◼ Can be self-contradictory
◼ Can be incomplete
5
Weakness of Natural Language Specifications
Withdraw:
Natural language descriptions do not have a fixed meaning, they are ambiguous.
These notations do not have a fixed semantics
Incomplete specifications
A specification can be considered incomplete when the behaviour
is not completely defined.
Withdraw:
Withdraw:
OVERDRAFT?
Formal Languages
It is desirable to use a specification notation with a fixed, unambiguous,
semantics.
Notations that have a fixed semantics are known as formal notations, or formal
languages.
10
Formal Methods for the Problems
Formal methods = Formal Specification
+
Refinement
+
Formal Verification
12
Introduction to Formal
Specification
13
Formal Specification Language
◼ Unambiguous
14
Levels of Formal Specification
LEVEL 0 1. 1. Requirements Only
Formal Specification 2. No Analysis/Proof
3. Cost effective
16
Specification Parts
◼ A specification need to include
◼ Details of the system
◼ The states it can occupy
◼ Dynamic aspects
◼ All operations which are possible
17
Specification Parts
18
Specification Parts
◼ A specification will include
◼ Non-functional requirements (properties)
◼ All data access should be via company supplied subroutines
19
Specification Parts
◼ A specification will include
◼ Design directives
◼ The system will collect data from …
◼ Data Statements
◼ The system must maintain the average temperature over the preceding …
21
Definition - Formal Specification
◼ The approach is especially important in high-integrity
systems, for example where safety or security is
important, to help ensure that errors are not
introduced into the development process.
22
Definition - with a Scientist’s Quote
◼ Formal methods are particularly effective early in
development at the requirements and specification levels.
◼ Software engineers want to be real engineers.
23
Formal Methods - Parts
◼ Program specification
◼ Program verification
◼ Model checking
24
Formal Methods - Program Specification
◼ A program specification is the definition of what a
computer program is expected to do
◼ It can be
◼ informal, in which case it can be considered as a blueprint or
user manual from a developer point of view, or
25
Formal Methods - Program Verification
◼ In computer science, program verification is the process of
formally proving that a computer program does exactly what is
stated in the program specification it was written to realize
27
Formal Methods - Model Checking
◼ Model checking is a method to algorithmically verify
formal systems. This is achieved by verifying if the
model, often deriving from a hardware or software
design, satisfies a formal specification. The specification
is often written as temporal logic formulas.
28
Formal VS. Informal Methods
◼ Formal specification vs. SSADM
◼ SSADM
◼ now government standard
◼ Widely used in industry
29
Formal VS. Informal Methods
◼ Lots of possible inconsistencies
◼ Decision tables
30
Specification - Mathematics vs. Natural Language
◼ Deficiencies of natural language
◼ Can be vague
◼ Can be ambiguous
◼ Can be self-contradictory
◼ Can be incomplete
31
Specification - Mathematics - Good Features
◼ Easily handle abstractions
◼ Is concise
◼ Is non-ambiguous
32
Specification - Mathematics - Good Features
◼ Is applied widely to the real world
33
Formal Notation – Drawbacks
34
Formal
◼ Logic Specification Methods
◼ Z, VDM, First order logic, temporal logic
◼ State Machines
◼ Finite state machines, communicating state
◼ Petri Nets
35
Z
◼ Parts of specification
◼ Natural language
◼ Z specification language
37
Good papers to begin with:
◼ “Formal Methods: State of the Art and Future Directions”,
Edmund M. Clarke, Jeannette M. Wing, ACM Computing
Surveys, 1996
38
Case Studies: CUTE
39
Case Studies: CUTE
40
Case Studies: Intel’s Successes
http://www.cse.ogi.edu/S3S/JohnHarrison.pdf
41
Case Studies: NASA SATS
◼ Small Aircraft Transportation System (SATS)
http://sats.nasa.gov/
43
Chuti?
Nai
44