0% found this document useful (0 votes)
5 views

Week 1 (Part1)

The document discusses the importance of formal methods in software development, highlighting the Software Development Life Cycle (SDLC) and the role of specifications in ensuring software correctness. It emphasizes that ambiguous and incomplete specifications can lead to errors and failures, and advocates for the use of formal notations to create unambiguous specifications. Additionally, it outlines the advantages of formal methods, including improved test case generation and early feedback on system specifications.

Uploaded by

hammadkhan31752
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Week 1 (Part1)

The document discusses the importance of formal methods in software development, highlighting the Software Development Life Cycle (SDLC) and the role of specifications in ensuring software correctness. It emphasizes that ambiguous and incomplete specifications can lead to errors and failures, and advocates for the use of formal notations to create unambiguous specifications. Additionally, it outlines the advantages of formal methods, including improved test case generation and early feedback on system specifications.

Uploaded by

hammadkhan31752
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

CS636 Formal Methods

Topics Covered
Introduction to Formal Methods
Software Development Life
Cycle (SDLC)
 Software increasing in size and complexity
 A Systematic approach is required called SDLC
 Requirement Specification
 Design
 Coding
 Deployment
Software Errors
 Increased size and complexity leads to software errors
 Error: software does not provide the intended behavior
 Errors lead to failure
 Cost

 High relieability software cannot tolerate errors


 Incorrect specifications OR Specification were not followed (misinterpreted)
 Specifications are important for error free software
Software Specifications
 Correctness of entire software depends on specification
 Ripple affect

Currently written in natural language and diagrammatic


notations (UML for example)
 Ambiguous
 Incomplete
 Inconsistent
Software Specifications
Withdraw: Receives a requested amount to withdraw from the bank
account and, if there are sufficient funds in the account, meets the
request. Returns a boolean value indicating success or failure of the
attempt to withdraw money from the account.

• Is it that the bank account must contain at least the


amount of money that Is requested for withdrawal?
• Or is there a minimum balance that must be
maintained?
A typical UML diagram for the BankAccount class *
• Or is there an agreed overdraft limit?

* Formal Software Development, from VDB to Java by Quentin Charatan and Aaron Kans
Software Specifications
 Specification of “Withdraw” method is:
 Ambiguous (different interpretations)
 Incomplete (What should happen when there is insufficient amount)

 Inconsistent (Overdraft facility may be defined somewhere else)


Software Testing
 Testing aims to locate the errors
 Testing cannot take place until some implementation is available
 Correcting errors identified by testing may introduce new errors

 Testing can uncover errors, does not guarantee absence of them

 Testing is based on specifications, ambiguous specifications may make

testing ineffective
Formal Notations
 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.


 A fixed semantics is achieved by defining a language in a

completely unambiguous way using a mathematical


framework.
Formal Methods
 Formal methods are methods that use formulas. A formula
is a text or diagram constructed from predefined symbols
combined according to explicit rules.

 A good working definition of formula is anything whose


appearance or syntax can be checked by a computer.
 Z language
Formal Methods
• Formal methods constitute a branch of software
engineering that incorporates the use of mathematics for
software development.
• Formal methods use formula. A good working definition of
formula is anything whose appearance or syntax can be
checked by a computer.
Advantages of formal methods
 Formal specifications can help considerably in generating
suitable test cases.
 Formal specifications allow for feedback on system

specifications at early development stages


 Important properties (such as internal consistency) of the initial

specification can be checked mathematically


 A proof of program correctness can be constructed
 Proofs can help uncover design errors as soon as they are made
Thank You

You might also like