SlideShare a Scribd company logo
MCA –Software Engineering
Kantipur City College
Topics include
Formal Methods Concept
Formal Specification
Language
Test plan creation
Test-case generation
Executable and non-
executable specifications
Pre and Post assertions
Formal verification
Formal methods
Concept
• 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 to produce consistent,
complete, and correct specification of software.
• Formal methods include
– Formal specification
– Specification analysis and proof
– Transformational development
– Program verification
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 hard to scale up to large systems
Use of Formal Methods
• Formal methods have limited practical applicability.
• Their principal benefits are in reducing the number of
errors in systems.
• Formal specification techniques are most applicable
in the development of critical systems and
standards.
• In this area, the use of formal methods is most likely
to be cost-effective.
Advantages of Formal
Specification
• It can be studied mathematically.
• Correctness of modules can be proved
• Equivalency can be proved.
• Incomplete definitions and inconsistencies can be
detected, and
• In some cases, it may be produced automatically
from requirement statements.
Specification in a Software
Process
• Specification and design are inextricably
intermingled.
• Architectural design is essential to structure a
specification.
• Formal specifications are expressed in a
mathematical notation with precisely defined
vocabulary, syntax ( Syn) and semantics (sem).
• The semantics and syntax of a formal
specification language are very much like any
high level programming language.
Specification and Design
Architectural
design
Requirements
specification
Requirements
definition
Software
specification
High-level
design
Increasing contractor involvement
Decreasing client involvement
Specification
Design
Requirements
specification
Formal
specification
System
modelling
Architectural
design
Requirements
definition
High-level
design
Specification in a Software
Process
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 much as the amount of rework due to
requirements problems is reduced
Development cost of
Formal Specification
Specification
Design and
Implementation
Validation
Specification
Design and
Implementation
Validation
Cost
Without formal
specification
With formal
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
Specification Techniques
• Algebraic approach
– The system is specified in terms of its operations and
their relationships.
– Algebraic techniques are suited to interface specification
where the interface is defined as a set of object classes.
• Model-based approach
– The system is specified in terms of a state model that is
constructed using mathematical constructs such as sets
and sequences. Operations are defined by modifications
to the system’s state.
Formal Specification
Languages
•A formal Specification Language are based on
mathematical logic and provides for automatic logic
verification.
•A formal specification may be checked for inconsistencies
and contradictions before being coded in a programming
language.
Mathematical Logic
Symbol Meaning
∀ For all ( a qualifier)
∃ There exists ( a qualifier)
P Ξ Q P is logically equivalent to Q
~ p Not p
P^q p and q
P v q p or q
P Q If p then q
P Q P implies q
P Q P if and only if q
э Such that
P Q P does not imply q
Examples using Logic
Symbols
∀∀ x,y,z x > y^y >z x>z
• Description: For all numeric values x,y and z for
which x is larger than y and y is larger than z, x is
larger than z.
Pre and Post
Assertions
• A set of constraints associated with a formula are
called assertions and are used to express
preconditions and post-conditions for a given
tasks.
• The preconditions are normally constraints placed
on the input to a given formula ( task), and post
conditions are constraints placed on the output or
results of the formula ( task).
• The general format for specifying a functional task
using formal specification is to define the
preconditions, the process and the post conditions
within the syntax and semantics of formal
language being used.
Example of formal
specification
• Example 1: Suppose M, N and q are integer values. The
task is to compute N/M only if N is divisible by M.
• Definition:
{ ∃ q э N = q x M } Precondition
Program to compute N/M
{ Output q = N/M } Post-condition
Description: These equations mean that if for integer values
of N and M there exists an integer value q such that N is
equal to q times M; then the output of the program should
be the quotient of N divided by M.
Example of formal
specification
• Example 2: The following is a specification for a function
that must read two numbers and report the larger of the
two numbers.
• Definition:
{ True } Precondition
Program to read x and y
{ (Output = x) ^ (x>y) V ( Output = y) ^ (y>x) } Post-condition
• Description: There is no precondition. That is, the program
should work for any pair of ordered values. The post
condition defines the output to be x if x > y or to be y if y>
x.
Example of formal
specification
• Example 3: The following are the precondition and post-
condition for a function that is meat to sort an array of
positive integers.
• Definition:
{ n>0, ∀i (0<I ≤n) ( a[i] > 0 } Precondition
Program to soft array a[1,…n]
{∀I (0<i<n) a[i] ≤ a[i+1]} Post-condition
Description: These equations mean that before the task is
performed we have an array of positive integers, after the
task is performed we have the same array of positive
integers, and the content of the array is in ascending
order.
Behavioural
Specification
• Algebraic specification can be cumbersome when
the object operations are not independent of the
object state
• Model-based specification exposes the system
state and defines the operations in terms of
changes to that state
• The Z notation is a mature technique for model-
based specification. It combines formal and
informal description and uses graphical
highlighting when presenting specifications
References
 From software engineering, A practitioner’s approach by Roger S.
Pressman
– Chapter 25: Formal Methods
• Basic concepts, deficiencies of Less formal approaches,
• Formal methods concept, Mathematical preliminaries
• Formal specification languages
• Summary of Z Notation.
 From Software Engineering, Ian Sommerville
– Part5: Verification and Validation
• Chapter 9: Formal Specification
• Chapter 21: Critical System Validation
 From Software Engineering Fundamentals by Ali Behforooz and F.J.
Hudson
- Chapter 5: Software Specification Tools

More Related Content

What's hot

Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
Aman Adhikari
 
Software Quality Management
Software Quality ManagementSoftware Quality Management
Software Quality ManagementKrishna Sujeer
 
Software Re-Engineering
Software Re-EngineeringSoftware Re-Engineering
Software Re-Engineering
Saqib Raza
 
Formal Methods
Formal MethodsFormal Methods
Formal Methods
HendMuhammad
 
INTEGRATION TESTING
INTEGRATION TESTINGINTEGRATION TESTING
INTEGRATION TESTING
RohitK71
 
Cost of software quality ( software quality assurance )
Cost of software quality ( software quality assurance )Cost of software quality ( software quality assurance )
Cost of software quality ( software quality assurance )
Kiran Hanjar
 
Software Engineering Process Models
Software Engineering Process Models Software Engineering Process Models
Software Engineering Process Models
Satya P. Joshi
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
Inocentshuja Ahmad
 
Software engineering project management
Software engineering project managementSoftware engineering project management
Software engineering project management
jhudyne
 
System dependability
System dependabilitySystem dependability
System dependability
sommerville-videos
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
Siva Priya
 
Software Engineering - chp8- deployment
Software Engineering - chp8- deploymentSoftware Engineering - chp8- deployment
Software Engineering - chp8- deployment
Lilia Sfaxi
 
Software Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptx
ubaidullah75790
 
Insulin pump overview
Insulin pump overviewInsulin pump overview
Insulin pump overview
software-engineering-book
 
SQE Lecture 1.pptx
SQE Lecture 1.pptxSQE Lecture 1.pptx
SQE Lecture 1.pptx
UsmanShafique23
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
SHREEHARI WADAWADAGI
 
Requirement specification (SRS)
Requirement specification (SRS)Requirement specification (SRS)
Requirement specification (SRS)
kunj desai
 
Chapter 1 2 - some size factors
Chapter 1   2 - some size factorsChapter 1   2 - some size factors
Chapter 1 2 - some size factors
NancyBeaulah_R
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testing
Haris Jamil
 

What's hot (20)

Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
 
Software Quality Management
Software Quality ManagementSoftware Quality Management
Software Quality Management
 
Software Re-Engineering
Software Re-EngineeringSoftware Re-Engineering
Software Re-Engineering
 
Formal Methods
Formal MethodsFormal Methods
Formal Methods
 
INTEGRATION TESTING
INTEGRATION TESTINGINTEGRATION TESTING
INTEGRATION TESTING
 
Cost of software quality ( software quality assurance )
Cost of software quality ( software quality assurance )Cost of software quality ( software quality assurance )
Cost of software quality ( software quality assurance )
 
Software Engineering Process Models
Software Engineering Process Models Software Engineering Process Models
Software Engineering Process Models
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
Software engineering project management
Software engineering project managementSoftware engineering project management
Software engineering project management
 
System dependability
System dependabilitySystem dependability
System dependability
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
 
Software Engineering - chp8- deployment
Software Engineering - chp8- deploymentSoftware Engineering - chp8- deployment
Software Engineering - chp8- deployment
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Software Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptx
 
Insulin pump overview
Insulin pump overviewInsulin pump overview
Insulin pump overview
 
SQE Lecture 1.pptx
SQE Lecture 1.pptxSQE Lecture 1.pptx
SQE Lecture 1.pptx
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
Requirement specification (SRS)
Requirement specification (SRS)Requirement specification (SRS)
Requirement specification (SRS)
 
Chapter 1 2 - some size factors
Chapter 1   2 - some size factorsChapter 1   2 - some size factors
Chapter 1 2 - some size factors
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testing
 

Viewers also liked

Formal Methods lecture 01
Formal Methods lecture 01Formal Methods lecture 01
Formal Methods lecture 01Sidra Ashraf
 
#1 formal methods – introduction for software engineering
#1 formal methods – introduction for software engineering#1 formal methods – introduction for software engineering
#1 formal methods – introduction for software engineering
Sharif Omar Salem
 
The standish group chaos report
The standish group chaos report The standish group chaos report
The standish group chaos report
Mizno Kruge
 
Formal methods 4 - Z notation
Formal methods   4 - Z notationFormal methods   4 - Z notation
Formal methods 4 - Z notation
Vlad Patryshev
 
Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9koolkampus
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
Mukesh Tekwani
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit IIIManoj Patil
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 

Viewers also liked (9)

Formal Methods lecture 01
Formal Methods lecture 01Formal Methods lecture 01
Formal Methods lecture 01
 
#1 formal methods – introduction for software engineering
#1 formal methods – introduction for software engineering#1 formal methods – introduction for software engineering
#1 formal methods – introduction for software engineering
 
The standish group chaos report
The standish group chaos report The standish group chaos report
The standish group chaos report
 
Formal methods 4 - Z notation
Formal methods   4 - Z notationFormal methods   4 - Z notation
Formal methods 4 - Z notation
 
Z specification
Z specificationZ specification
Z specification
 
Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit III
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 

Similar to Mca se chapter_9_formal_methods

11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
asifusman1998
 
Unit 1 sepm cleanroom engineering
Unit 1 sepm cleanroom engineeringUnit 1 sepm cleanroom engineering
Unit 1 sepm cleanroom engineering
KanchanPatil34
 
SW Project Process.pptx
SW Project Process.pptxSW Project Process.pptx
SW Project Process.pptx
KarthigaiSelviS3
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
Neha Singh
 
Requirements analysis lecture
Requirements analysis lectureRequirements analysis lecture
Requirements analysis lecture
Makerere University
 
Requirement verification & validation
Requirement verification & validationRequirement verification & validation
Requirement verification & validationAbdul Basit
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
CHANDUKAYALA
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
Rohit846825
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
PrashanthJanakiraman
 
Building largescalepredictionsystemv1
Building largescalepredictionsystemv1Building largescalepredictionsystemv1
Building largescalepredictionsystemv1
arthi v
 
Cse
CseCse
Project Estimation
Project EstimationProject Estimation
Project Estimation
Kasun Ranga Wijeweera
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07uShubham Sharma
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
Raheel Aslam
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
Praveen Penumathsa
 
Verifying and Validating Requirements
Verifying and Validating RequirementsVerifying and Validating Requirements
Verifying and Validating Requirements
Ravikanth-BA
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
Software requirement verification & validation
Software requirement verification & validationSoftware requirement verification & validation
Software requirement verification & validationAbdul Basit
 
Steps in Simulation Study
Steps in Simulation StudySteps in Simulation Study
Steps in Simulation Study
Nalin Adhikari
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit design
Maitree Patel
 

Similar to Mca se chapter_9_formal_methods (20)

11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Unit 1 sepm cleanroom engineering
Unit 1 sepm cleanroom engineeringUnit 1 sepm cleanroom engineering
Unit 1 sepm cleanroom engineering
 
SW Project Process.pptx
SW Project Process.pptxSW Project Process.pptx
SW Project Process.pptx
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
 
Requirements analysis lecture
Requirements analysis lectureRequirements analysis lecture
Requirements analysis lecture
 
Requirement verification & validation
Requirement verification & validationRequirement verification & validation
Requirement verification & validation
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
Building largescalepredictionsystemv1
Building largescalepredictionsystemv1Building largescalepredictionsystemv1
Building largescalepredictionsystemv1
 
Cse
CseCse
Cse
 
Project Estimation
Project EstimationProject Estimation
Project Estimation
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07u
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
Verifying and Validating Requirements
Verifying and Validating RequirementsVerifying and Validating Requirements
Verifying and Validating Requirements
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
Software requirement verification & validation
Software requirement verification & validationSoftware requirement verification & validation
Software requirement verification & validation
 
Steps in Simulation Study
Steps in Simulation StudySteps in Simulation Study
Steps in Simulation Study
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit design
 

More from Aman Adhikari

Algorithmic Toolbox Certificate from Coursera for Aman Adhikari
Algorithmic Toolbox Certificate from Coursera for Aman AdhikariAlgorithmic Toolbox Certificate from Coursera for Aman Adhikari
Algorithmic Toolbox Certificate from Coursera for Aman Adhikari
Aman Adhikari
 
Vp all slides
Vp   all slidesVp   all slides
Vp all slides
Aman Adhikari
 
Mca se chapter_07_software_validation
Mca se chapter_07_software_validationMca se chapter_07_software_validation
Mca se chapter_07_software_validation
Aman Adhikari
 
Mca 1st & 2nd final
Mca 1st & 2nd finalMca 1st & 2nd final
Mca 1st & 2nd final
Aman Adhikari
 
Software testing
Software testingSoftware testing
Software testing
Aman Adhikari
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
Aman Adhikari
 
Software project plannings
Software project planningsSoftware project plannings
Software project plannings
Aman Adhikari
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
Aman Adhikari
 
Software project plannings
Software project planningsSoftware project plannings
Software project plannings
Aman Adhikari
 
Software engineering mca
Software engineering mcaSoftware engineering mca
Software engineering mca
Aman Adhikari
 
Software ee1
Software ee1Software ee1
Software ee1
Aman Adhikari
 
Software ee111
Software ee111Software ee111
Software ee111
Aman Adhikari
 
Research problem unit2 supplementary
Research problem unit2 supplementaryResearch problem unit2 supplementary
Research problem unit2 supplementary
Aman Adhikari
 
Research methodology unit i
Research methodology unit iResearch methodology unit i
Research methodology unit i
Aman Adhikari
 
Research methodology unit6
Research methodology unit6Research methodology unit6
Research methodology unit6
Aman Adhikari
 
Research methodology – unit5
Research methodology – unit5Research methodology – unit5
Research methodology – unit5
Aman Adhikari
 
Research methodology – unit 9
Research methodology – unit 9Research methodology – unit 9
Research methodology – unit 9
Aman Adhikari
 
Research methodology – unit 4
Research methodology – unit 4Research methodology – unit 4
Research methodology – unit 4
Aman Adhikari
 
Research methodology unit5
Research methodology   unit5Research methodology   unit5
Research methodology unit5
Aman Adhikari
 
Research methodology unit four
Research methodology   unit fourResearch methodology   unit four
Research methodology unit four
Aman Adhikari
 

More from Aman Adhikari (20)

Algorithmic Toolbox Certificate from Coursera for Aman Adhikari
Algorithmic Toolbox Certificate from Coursera for Aman AdhikariAlgorithmic Toolbox Certificate from Coursera for Aman Adhikari
Algorithmic Toolbox Certificate from Coursera for Aman Adhikari
 
Vp all slides
Vp   all slidesVp   all slides
Vp all slides
 
Mca se chapter_07_software_validation
Mca se chapter_07_software_validationMca se chapter_07_software_validation
Mca se chapter_07_software_validation
 
Mca 1st & 2nd final
Mca 1st & 2nd finalMca 1st & 2nd final
Mca 1st & 2nd final
 
Software testing
Software testingSoftware testing
Software testing
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
 
Software project plannings
Software project planningsSoftware project plannings
Software project plannings
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
 
Software project plannings
Software project planningsSoftware project plannings
Software project plannings
 
Software engineering mca
Software engineering mcaSoftware engineering mca
Software engineering mca
 
Software ee1
Software ee1Software ee1
Software ee1
 
Software ee111
Software ee111Software ee111
Software ee111
 
Research problem unit2 supplementary
Research problem unit2 supplementaryResearch problem unit2 supplementary
Research problem unit2 supplementary
 
Research methodology unit i
Research methodology unit iResearch methodology unit i
Research methodology unit i
 
Research methodology unit6
Research methodology unit6Research methodology unit6
Research methodology unit6
 
Research methodology – unit5
Research methodology – unit5Research methodology – unit5
Research methodology – unit5
 
Research methodology – unit 9
Research methodology – unit 9Research methodology – unit 9
Research methodology – unit 9
 
Research methodology – unit 4
Research methodology – unit 4Research methodology – unit 4
Research methodology – unit 4
 
Research methodology unit5
Research methodology   unit5Research methodology   unit5
Research methodology unit5
 
Research methodology unit four
Research methodology   unit fourResearch methodology   unit four
Research methodology unit four
 

Recently uploaded

Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

Mca se chapter_9_formal_methods

  • 2. Topics include Formal Methods Concept Formal Specification Language Test plan creation Test-case generation Executable and non- executable specifications Pre and Post assertions Formal verification
  • 3. Formal methods Concept • 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 to produce consistent, complete, and correct specification of software. • Formal methods include – Formal specification – Specification analysis and proof – Transformational development – Program verification
  • 4. 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 hard to scale up to large systems
  • 5. Use of Formal Methods • Formal methods have limited practical applicability. • Their principal benefits are in reducing the number of errors in systems. • Formal specification techniques are most applicable in the development of critical systems and standards. • In this area, the use of formal methods is most likely to be cost-effective.
  • 6. Advantages of Formal Specification • It can be studied mathematically. • Correctness of modules can be proved • Equivalency can be proved. • Incomplete definitions and inconsistencies can be detected, and • In some cases, it may be produced automatically from requirement statements.
  • 7. Specification in a Software Process • Specification and design are inextricably intermingled. • Architectural design is essential to structure a specification. • Formal specifications are expressed in a mathematical notation with precisely defined vocabulary, syntax ( Syn) and semantics (sem). • The semantics and syntax of a formal specification language are very much like any high level programming language.
  • 10. 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 much as the amount of rework due to requirements problems is reduced
  • 11. Development cost of Formal Specification Specification Design and Implementation Validation Specification Design and Implementation Validation Cost Without formal specification With formal 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
  • 12. Specification Techniques • Algebraic approach – The system is specified in terms of its operations and their relationships. – Algebraic techniques are suited to interface specification where the interface is defined as a set of object classes. • Model-based approach – The system is specified in terms of a state model that is constructed using mathematical constructs such as sets and sequences. Operations are defined by modifications to the system’s state.
  • 13. Formal Specification Languages •A formal Specification Language are based on mathematical logic and provides for automatic logic verification. •A formal specification may be checked for inconsistencies and contradictions before being coded in a programming language.
  • 14. Mathematical Logic Symbol Meaning ∀ For all ( a qualifier) ∃ There exists ( a qualifier) P Ξ Q P is logically equivalent to Q ~ p Not p P^q p and q P v q p or q P Q If p then q P Q P implies q P Q P if and only if q э Such that P Q P does not imply q
  • 15. Examples using Logic Symbols ∀∀ x,y,z x > y^y >z x>z • Description: For all numeric values x,y and z for which x is larger than y and y is larger than z, x is larger than z.
  • 16. Pre and Post Assertions • A set of constraints associated with a formula are called assertions and are used to express preconditions and post-conditions for a given tasks. • The preconditions are normally constraints placed on the input to a given formula ( task), and post conditions are constraints placed on the output or results of the formula ( task). • The general format for specifying a functional task using formal specification is to define the preconditions, the process and the post conditions within the syntax and semantics of formal language being used.
  • 17. Example of formal specification • Example 1: Suppose M, N and q are integer values. The task is to compute N/M only if N is divisible by M. • Definition: { ∃ q э N = q x M } Precondition Program to compute N/M { Output q = N/M } Post-condition Description: These equations mean that if for integer values of N and M there exists an integer value q such that N is equal to q times M; then the output of the program should be the quotient of N divided by M.
  • 18. Example of formal specification • Example 2: The following is a specification for a function that must read two numbers and report the larger of the two numbers. • Definition: { True } Precondition Program to read x and y { (Output = x) ^ (x>y) V ( Output = y) ^ (y>x) } Post-condition • Description: There is no precondition. That is, the program should work for any pair of ordered values. The post condition defines the output to be x if x > y or to be y if y> x.
  • 19. Example of formal specification • Example 3: The following are the precondition and post- condition for a function that is meat to sort an array of positive integers. • Definition: { n>0, ∀i (0<I ≤n) ( a[i] > 0 } Precondition Program to soft array a[1,…n] {∀I (0<i<n) a[i] ≤ a[i+1]} Post-condition Description: These equations mean that before the task is performed we have an array of positive integers, after the task is performed we have the same array of positive integers, and the content of the array is in ascending order.
  • 20. Behavioural Specification • Algebraic specification can be cumbersome when the object operations are not independent of the object state • Model-based specification exposes the system state and defines the operations in terms of changes to that state • The Z notation is a mature technique for model- based specification. It combines formal and informal description and uses graphical highlighting when presenting specifications
  • 21. References  From software engineering, A practitioner’s approach by Roger S. Pressman – Chapter 25: Formal Methods • Basic concepts, deficiencies of Less formal approaches, • Formal methods concept, Mathematical preliminaries • Formal specification languages • Summary of Z Notation.  From Software Engineering, Ian Sommerville – Part5: Verification and Validation • Chapter 9: Formal Specification • Chapter 21: Critical System Validation  From Software Engineering Fundamentals by Ali Behforooz and F.J. Hudson - Chapter 5: Software Specification Tools