You are on page 1of 25

Chapter 1

Introduction
Msc Thai Thuy Han Uyen
Rate of course assessment

 In-class: 50% (Roll-call: 10%, project: 40%)


 Final exam: 50%

2
Word
s

Language

Rules of
combination
Structure
to
d way
communicat
e meaning
3
Natural languages

Vietnamese

English

French

4
Programming languages

Pascal Java C++

Visual Basic Python

Object C
5
Animal languages

Bird Fish Cat

6
Other languages

SQL XML

JSON HTML

UML
7
Formal language
 A formal language 
consists of words whose letters are taken from an 
alphabet and are well-formed according to a specific
set of rules.

 The alphabet of a formal language consists of


symbols, letters, or tokens that concatenate into
strings of the language.

8
Formal language - Example
Ex1: Max2PositiveNum (a1 : R , a2 : R) kq : R
pre ( (a1 > 0) && ( a2 >0) )
post ( (kq = a1) && (a1 >=a2))
||((kq=a2)&&(a2>a1))

Ex2: Func (a:R*, n:N)kq:B


pre
post kq = (TT i TH {1..n-1}.a(i) <= a(i+1))

9
Formal specification

Description of a system using a mathematical notation

10
Formal specification

Precise

Unambiguous

11
Formal method
 Formal specification is part of a more general
collection of techniques that are known as ‘formal
methods’.
 These are all based on mathematical representation
and analysis of software.
 Formal methods include
 Formal specification;
 Specification analysis and proof;
 Transformational development;
 Program verification.

12
Specification in the software process

Requirements
Analysis
Design
Implementation
Testing
Maintenance

13
Development costs with
formal specification
7

0
Without formal specification With formal specification
14
Analysis Design and Implementation Testing
Cost profile
The use of formal specification means that the cost profile
of a project changes

 There are greater up front costs as more time and


effort are spent developing the analysis.

 However, implementation and testing costs should be


reduced as the analysis process reduces errors and
ambiguities in the requirements.

15
Use of formal specification
 Formal specification involves investing more effort in
the early phases of software development.

 This reduces requirements errors as it forces a detailed


analysis of the requirements.

 Incompleteness and inconsistencies can be discovered


and resolved.

 Hence, savings as made as the amount of rework due to


requirements problems is reduced.
16
Use of formal methods
 The principal benefits of formal methods are in reducing
the number of faults in systems.

 Consequently, their main area of applicability is in


critical systems engineering. There have been several
successful projects where formal methods have been
used in this area.

 In this area, the use of formal methods is most likely to


be cost-effective because high system failure costs must
be avoided.

17
Acceptance of formal methods
Formal methods have not become mainstream software
development techniques as was once predicted
 Other software engineering techniques have been successful
at increasing system quality. Hence the need for formal
methods has been reduced.
 Market changes have made time-to-market rather than
software with a low error count the key factor. Formal
methods do not reduce time to market.
 The scope of formal methods is limited. They are not well-
suited to specifying and analysing user interfaces and user
interaction.
 Formal methods are still hard to scale up to large systems.

18
Some formal specification languages

VDM-SL CCS
Z CSP
RSL Real-Time Logic
Act One Deontic Logics
Clear

19
Course project

20
Course project

21
Course project

22
Course project

23
Key points
 Formal system specification complements informal
specification techniques.

 Formal specifications are precise and unambiguous.


They remove areas of doubt in a specification.

 Formal specification forces an analysis of the


system requirements at an early stage. Correcting
errors at this stage is cheaper than modifying a
delivered system.

 Formal specification techniques are most


applicable in the development of critical systems
and standards. 24
Question and Answer

25

You might also like