Formal methods in Software Engineering
Engr. Muhammad Naeem
Lecturer#1&2
Department of Computer Engineering
Contents:
Formal Method
Advantage
Disadvantage
Critical Software
Integrity Level
Stages in Formal Methods
ASSESMENT IS INCLUDED
Formal Method
Formal method is a process of taking the specification
(written in natural language) and converts it into its
mathematical equivalent. Normally it is used at the Analysis
and Design stages of SDLC . The specifications in a natural
language usually contains ambiguous, incomplete and
inconsistent statements.
If a specification written in English, for example is translated
to a mathematical form, it will eliminate all ambiguity and
uncertainty in that statement.
Formal Methods continued……
Formal method will also highlights all the
different possible viewpoints to any given
variables and functions that could have been
hidden behind the English language.
This can be done using a number of formal
languages such as Z notation, VDM ( Vienna
Development Method), Algebra and
Functional Programming.
Advantages of FM
Formal Method forces the System Analyst and
Designer to think carefully about the specification.
Enforces proper engineering approaches using
discrete mathematics.
Formal Method forces the System Analyst and
Designer to see all the different possible states
and solutions for a problem.
Avoid many faults and therefore reduces the bugs
and errors from the design stage onward.
Disadvantage of formal method
Formal Method requires the person to know
how to apply discrete mathematics.
There are too many different formal methods
and most of them are not well-matched with
each other.
Formal methods do not guarantee that a
specification is complete.
Critical software
1. Business Critical System
Business Critical System refers to a system where the honesty and integrity of the
business is dominant. All data kept in the system must be accurate at all times. If a
fault is found the entire process must be stop to allow correction. Most government,
business and manufacturing companies that requires payment are business critical.
2. Mission Critical System
Mission Critical System refers to a system where the continuous running of the system
is dominant. Accurate takes a lower priority compare to the running of the system.
Auto Teller Machine, Car ticketing system, Alarm Systems are mission critical.
3. Safety Critical System
Safety Critical System refers to a system where the safety of everyone directly or
indirectly affected by the system is dominant. Functionality and Accurate takes a lower
priority compare to the safety of the users. Most medical, construction and oil
engineer systems are safety critical system.
Integrity Level
Integrity level refers to how much cost is an
organization is willing to spend and how much
risk is an organization is willing to take when
developing software.
Stages in Formal Method:
Formal Method is divided into four main
stages.
1. Formal Specification
In this stage the normal system specification is used
and the specifications are translated into a formal
specification with the help of formal language.
Basically there are two types of formal languages.
1. Model Oriented: VDM (Vienna Development
Method), Z notations.
2. Properties Oriented: (Algebraic Logic, Temporal
Logic, etc). This is the cheapest way to handle
formal method.
Processes of formal specification
1. Get user requirements from the specification written in the
natural language.
2. Clarify the requirement using mathematical approaches. This is to
remove all ambiguous, incomplete and inconsistent statements.
3. After statements are clearly identified. Then find all assumptions
(Things that must be in place before something can happen) that
is stated or not stated within the clarified requirement.
4. Then expose every possible logic defect (fault) or omission in the
clarified requirement.
5. Identify what are the exceptions (bad things) that will arise if the
defects are not corrected.
6. Find a way to test for all the possible each exception.
2. Formal Proof
This level studies the formal specification and retrieves the
goals of the formal specific. Then we create the set of fixed
rules with these rules step by step instructions are listed to
achieve the specified goals. This is the cheaper formal
methods.
3. Model Checking
At this stage we studies the formal specification and formal
proof deliverables to make sure that the system or software
contains ALL possible properties to be able to handle all
possible scenarios that could happen for a given
specification. This stage is beginning to be more expensive.
4. Abstraction
At this stage we uses mathematical and
physical models to create a prototype of the
entire system for simulation. This prototype is
used to focus on the properties and
characteristic of the system. This is the most
expensive formal method.
ASSESMENT NOTE
• Assessment should be submitted on time
• Assessment plays vital role in your grading
criteria.
• More informative is your assessment more
chances of Marvelous grading.
• Copy paste will not be accepted.
• DEADLINE( Next Week).
ASSESMENT#1
Role of formal method in critical
software.