SlideShare a Scribd company logo
Formal Specification Techniques for the unambiguous specification of software
Objectives To explain why formal specification techniques help discover problems in system requirements To describe the use of algebraic techniques for interface specification To describe the use of model-based techniques for behavioural specification
Topics covered Formal specification in the software process Interface specification Behavioural specification
Formal methods 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
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 so their mai area of applicability is critical systems In this area, the use of formal methods is most likely to be cost-effective
Specification in the 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 and semantics.
Specification and design
Specification in the software process
Specification techniques Algebraic approach The system is specified in terms of its operations and their relationships 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
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
Development costs with formal specification
Interface specification Large systems are decomposed into subsystems with well-defined interfaces between these subsystems Specification of subsystem interfaces allows independent development of the different subsystems Interfaces may be defined as abstract data types or object classes The algebraic approach to formal specification is particularly well-suited to interface specification
Sub-system interfaces
The structure of an algebraic specification
Specification components Introduction Defines the sort (the type name) and declares other specifications that are used Description Informally describes the operations on the type Signature Defines the syntax of the operations in the interface and their parameters Axioms Defines the operation semantics by defining axioms which characterise behaviour
Systematic algebraic specification Algebraic specifications of a system may be developed in a systematic way Specification structuring.  Specification naming.  Operation selection.  Informal operation specification Syntax definition Axiom definition
Specification operations Constructor operations. Operations which create entities of the type being specified Inspection operations. Operations which evaluate entities of the type being specified To specify behaviour, define the inspector operations for each constructor operation
Operations on a list ADT Constructor operations which evaluate to sort List Create, Cons and Tail Inspection operations which take sort list as a parameter and return some other sort Head and Length. Tail can be defined using the simpler  constructors Create and Cons. No need to define Head and Length with Tail.
List specification
Recursion in specifications Operations are often specified recursively Tail (Cons (L, v)) =  if  L = Create  then  Create  else  Cons (Tail (L), v) Cons ([5, 7], 9) = [5, 7, 9] Tail ([5, 7, 9])  =  Tail (Cons ( [5, 7], 9))  =  Cons (Tail ([5, 7]), 9) = Cons (Tail (Cons ([5], 7)), 9) = Cons (Cons (Tail ([5]), 7), 9) =  Cons (Cons (Tail (Cons ([], 5)), 7), 9) = Cons (Cons ([Create], 7), 9) = Cons ([7], 9) =  [7, 9]
Interface specification in critical systems Consider an air traffic control system where aircraft fly through managed sectors of airspace Each sector may include a number of aircraft but, for safety reasons, these must be separated In this example, a simple vertical separation of 300m is proposed The system should warn the controller if aircraft are instructed to move so that the separation rule is breached
A sector object Critical operations on an object representing a controlled sector are Enter. Add an aircraft to the controlled airspace Leave. Remove an aircraft from the controlled airspace Move. Move an aircraft from one height to another Lookup. Given an aircraft identifier, return its current height
Primitive operations It is sometimes necessary to introduce additional operations to simplify the specification The other operations can then be defined using these more primitive operations Primitive operations Create. Bring an instance of a sector into existence Put. Add an aircraft without safety checks In-space. Determine if a given aircraft is in the sector Occupied. Given a height, determine if there is an aircraft within 300m of that height
Sector specification
Specification commentary Use the basic constructors Create and Put to specify other operations Define Occupied and In-space using Create and Put and use them to make checks in other operation definitions All operations that result in changes to the sector must check that the safety criterion holds
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
The structure of a Z schema
An insulin pump
Modelling the insulin pump The schema models the insulin pump as a number of state variables reading? dose, cumulative_dose r0, r1, r2 capacity alarm! pump! display1!, display2! Names followed by a ? are inputs, names followed by a ! are outputs
Schema invariant Each Z schema has an invariant part which defines conditions that are always true For the insulin pump schema it is always true that The dose must be less than or equal to the capacity of the insulin reservoir No single dose may be more than 5 units of insulin and the total dose delivered in a time period must not exceed 50 units of insulin. This is a safety constraint (see Chapters 16 and 17) display1! shows the status of the insulin reservoir.
Insulin pump schema
The dosage computation The insulin pump computes the amount of insulin required by comparing the current reading with two previous readings If these suggest that blood glucose is rising then insulin is delivered Information about the total dose delivered is maintained to allow the safety check invariant to be applied Note that this invariant always applies - there is no need to repeat it in the dosage computation
DOSAGE schema
Output schemas The output schemas model the system displays and the alarm that indicates some potentially dangerous condition The output displays show the dose computed and a warning message The alarm is activated if blood sugar is very low - this indicates that the user should eat something to increase their blood sugar level
Output schemas
Schema consistency It is important that schemas are consistent. Inconsistency suggests a problem with the system requirements The INSULIN_PUMP schema and the DISPLAYare inconsistent display1! shows a warning message about the insulin reservoir (INSULIN_PUMP) display1! Shows the state of the blood sugar (DISPLAY) This must be resolved before implementation of the system
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
Key points Formal specification techniques are most applicable in the development of critical systems and standards. Algebraic techniques are suited to interface specification where the interface is defined as a set of object classes Model-based techniques model the system using sets and functions. This simplifies some types of behavioural specification
Ad

More Related Content

What's hot (20)

Phased life cycle model
Phased life cycle modelPhased life cycle model
Phased life cycle model
Stephennancy
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
srijavel
 
Software requirements specification
Software requirements specificationSoftware requirements specification
Software requirements specification
lavanya marichamy
 
Staffing level estimation
Staffing level estimation Staffing level estimation
Staffing level estimation
kavitha muneeshwaran
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
Saqib Raza
 
1.1 The nature of software.ppt
1.1 The nature of software.ppt1.1 The nature of software.ppt
1.1 The nature of software.ppt
JAYAPRIYAR7
 
Design notation
Design notationDesign notation
Design notation
ramya marichamy
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineering
kirupasuchi1996
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
Santhi thi
 
Language and Processors for Requirements Specification
Language and Processors for Requirements SpecificationLanguage and Processors for Requirements Specification
Language and Processors for Requirements Specification
kirupasuchi1996
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
Umaselvi_R
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
Hassan A-j
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costs
lalithambiga kamaraj
 
Analysis modeling & scenario based modeling
Analysis modeling &  scenario based modeling Analysis modeling &  scenario based modeling
Analysis modeling & scenario based modeling
Benazir Fathima
 
Quality and productivity factors
Quality and productivity factorsQuality and productivity factors
Quality and productivity factors
NancyBeaulah_R
 
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
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineering
Darshit Metaliya
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
Sutha31
 
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 Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptx
ubaidullah75790
 
Phased life cycle model
Phased life cycle modelPhased life cycle model
Phased life cycle model
Stephennancy
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
srijavel
 
Software requirements specification
Software requirements specificationSoftware requirements specification
Software requirements specification
lavanya marichamy
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
Saqib Raza
 
1.1 The nature of software.ppt
1.1 The nature of software.ppt1.1 The nature of software.ppt
1.1 The nature of software.ppt
JAYAPRIYAR7
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineering
kirupasuchi1996
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
Santhi thi
 
Language and Processors for Requirements Specification
Language and Processors for Requirements SpecificationLanguage and Processors for Requirements Specification
Language and Processors for Requirements Specification
kirupasuchi1996
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
Umaselvi_R
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
Hassan A-j
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costs
lalithambiga kamaraj
 
Analysis modeling & scenario based modeling
Analysis modeling &  scenario based modeling Analysis modeling &  scenario based modeling
Analysis modeling & scenario based modeling
Benazir Fathima
 
Quality and productivity factors
Quality and productivity factorsQuality and productivity factors
Quality and productivity factors
NancyBeaulah_R
 
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
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineering
Darshit Metaliya
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
Sutha31
 
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 Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptx
ubaidullah75790
 

Viewers also liked (20)

#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
 
Formal Methods
Formal MethodsFormal Methods
Formal Methods
HendMuhammad
 
Formal Methods lecture 01
Formal Methods lecture 01Formal Methods lecture 01
Formal Methods lecture 01
Sidra Ashraf
 
Z specification
Z specificationZ specification
Z specification
Falguni Roy
 
Formal methods 4 - Z notation
Formal methods   4 - Z notationFormal methods   4 - Z notation
Formal methods 4 - Z notation
Vlad Patryshev
 
Formal methods 1 - introduction
Formal methods   1 - introductionFormal methods   1 - introduction
Formal methods 1 - introduction
Vlad Patryshev
 
Industrial use of formal methods
Industrial use of formal methodsIndustrial use of formal methods
Industrial use of formal methods
Jonathan Bowen
 
Introduction To Software Engineering
Introduction To Software EngineeringIntroduction To Software Engineering
Introduction To Software Engineering
Leyla Bonilla
 
Software engineering lecture notes
Software engineering lecture notesSoftware engineering lecture notes
Software engineering lecture notes
Siva Ayyakutti
 
Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
ankush_kumar
 
software engineering
software engineeringsoftware engineering
software engineering
ramyavarkala
 
Ch10
Ch10Ch10
Ch10
phanleson
 
Using formal methods in Industrial Software Development
Using formal methods in Industrial Software DevelopmentUsing formal methods in Industrial Software Development
Using formal methods in Industrial Software Development
Robert van Lieshout
 
Mca se chapter_9_formal_methods
Mca se chapter_9_formal_methodsMca se chapter_9_formal_methods
Mca se chapter_9_formal_methods
Aman Adhikari
 
Ten Commandments of Formal Methods: A decade later
Ten Commandments of Formal Methods: A decade laterTen Commandments of Formal Methods: A decade later
Ten Commandments of Formal Methods: A decade later
Jonathan Bowen
 
Unit 1 importance ofsoftengg_b.tech iii year
Unit 1  importance ofsoftengg_b.tech iii yearUnit 1  importance ofsoftengg_b.tech iii year
Unit 1 importance ofsoftengg_b.tech iii year
Preeti Mishra
 
Introduction to formal methods
Introduction to formal methodsIntroduction to formal methods
Introduction to formal methods
Inzemamul Haque
 
#4 formal methods – predicate logic
#4 formal methods – predicate logic#4 formal methods – predicate logic
#4 formal methods – predicate logic
Sharif Omar Salem
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF Profiles
Philip Langer
 
Deduction theorem of propositional logic
Deduction theorem of propositional logicDeduction theorem of propositional logic
Deduction theorem of propositional logic
Saurabh Gupta
 
#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
 
Formal Methods lecture 01
Formal Methods lecture 01Formal Methods lecture 01
Formal Methods lecture 01
Sidra Ashraf
 
Formal methods 4 - Z notation
Formal methods   4 - Z notationFormal methods   4 - Z notation
Formal methods 4 - Z notation
Vlad Patryshev
 
Formal methods 1 - introduction
Formal methods   1 - introductionFormal methods   1 - introduction
Formal methods 1 - introduction
Vlad Patryshev
 
Industrial use of formal methods
Industrial use of formal methodsIndustrial use of formal methods
Industrial use of formal methods
Jonathan Bowen
 
Introduction To Software Engineering
Introduction To Software EngineeringIntroduction To Software Engineering
Introduction To Software Engineering
Leyla Bonilla
 
Software engineering lecture notes
Software engineering lecture notesSoftware engineering lecture notes
Software engineering lecture notes
Siva Ayyakutti
 
Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
ankush_kumar
 
software engineering
software engineeringsoftware engineering
software engineering
ramyavarkala
 
Using formal methods in Industrial Software Development
Using formal methods in Industrial Software DevelopmentUsing formal methods in Industrial Software Development
Using formal methods in Industrial Software Development
Robert van Lieshout
 
Mca se chapter_9_formal_methods
Mca se chapter_9_formal_methodsMca se chapter_9_formal_methods
Mca se chapter_9_formal_methods
Aman Adhikari
 
Ten Commandments of Formal Methods: A decade later
Ten Commandments of Formal Methods: A decade laterTen Commandments of Formal Methods: A decade later
Ten Commandments of Formal Methods: A decade later
Jonathan Bowen
 
Unit 1 importance ofsoftengg_b.tech iii year
Unit 1  importance ofsoftengg_b.tech iii yearUnit 1  importance ofsoftengg_b.tech iii year
Unit 1 importance ofsoftengg_b.tech iii year
Preeti Mishra
 
Introduction to formal methods
Introduction to formal methodsIntroduction to formal methods
Introduction to formal methods
Inzemamul Haque
 
#4 formal methods – predicate logic
#4 formal methods – predicate logic#4 formal methods – predicate logic
#4 formal methods – predicate logic
Sharif Omar Salem
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF Profiles
Philip Langer
 
Deduction theorem of propositional logic
Deduction theorem of propositional logicDeduction theorem of propositional logic
Deduction theorem of propositional logic
Saurabh Gupta
 
Ad

Similar to Formal Specification in Software Engineering SE9 (20)

SECh910
SECh910SECh910
SECh910
Joe Christensen
 
Formal Specifications in Formal Methods
Formal Specifications in Formal MethodsFormal Specifications in Formal Methods
Formal Specifications in Formal Methods
Haroon Ghazanfar
 
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.pptformal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
adnanshaheen425
 
Formal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th EditionFormal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th Edition
RupeshShrestha28
 
Modeling and Testing Dovetail in MagicDraw
Modeling and Testing Dovetail in MagicDrawModeling and Testing Dovetail in MagicDraw
Modeling and Testing Dovetail in MagicDraw
Gregory Solovey
 
Integrating testablity and diagnosis methods into airbus systems development ...
Integrating testablity and diagnosis methods into airbus systems development ...Integrating testablity and diagnosis methods into airbus systems development ...
Integrating testablity and diagnosis methods into airbus systems development ...
steveyang83
 
DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...
DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...
DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...
IEEEGLOBALSOFTTECHNOLOGIES
 
LECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfd
LECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfdLECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfd
LECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfd
nandemprasanna
 
Formal Method lecture_3 software Engineering.pdf
Formal Method lecture_3 software Engineering.pdfFormal Method lecture_3 software Engineering.pdf
Formal Method lecture_3 software Engineering.pdf
talhaahmad565510
 
debugging - system software
debugging - system softwaredebugging - system software
debugging - system software
Vicky Shan
 
Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17
koolkampus
 
Intro-Soft-Engg-2.pptx
Intro-Soft-Engg-2.pptxIntro-Soft-Engg-2.pptx
Intro-Soft-Engg-2.pptx
Viju Neduvathoor
 
Lecture 11 understanding requirements (3)
Lecture 11   understanding requirements (3)Lecture 11   understanding requirements (3)
Lecture 11 understanding requirements (3)
IIUI
 
Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5
koolkampus
 
software Processes
software Processessoftware Processes
software Processes
Seif Shaame
 
A model for run time software architecture adaptation
A model for run time software architecture adaptationA model for run time software architecture adaptation
A model for run time software architecture adaptation
ijseajournal
 
Maximizing SAP ABAP Performance
Maximizing SAP ABAP PerformanceMaximizing SAP ABAP Performance
Maximizing SAP ABAP Performance
PeterHBrown
 
Aspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSDAspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSD
Can R. PAHALI
 
Software testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationSoftware testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentation
vigneshasromio
 
SECh56
SECh56SECh56
SECh56
Joe Christensen
 
Formal Specifications in Formal Methods
Formal Specifications in Formal MethodsFormal Specifications in Formal Methods
Formal Specifications in Formal Methods
Haroon Ghazanfar
 
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.pptformal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
adnanshaheen425
 
Formal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th EditionFormal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th Edition
RupeshShrestha28
 
Modeling and Testing Dovetail in MagicDraw
Modeling and Testing Dovetail in MagicDrawModeling and Testing Dovetail in MagicDraw
Modeling and Testing Dovetail in MagicDraw
Gregory Solovey
 
Integrating testablity and diagnosis methods into airbus systems development ...
Integrating testablity and diagnosis methods into airbus systems development ...Integrating testablity and diagnosis methods into airbus systems development ...
Integrating testablity and diagnosis methods into airbus systems development ...
steveyang83
 
DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...
DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...
DOTNET 2013 IEEE MOBILECOMPUTING PROJECT Model based analysis of wireless sys...
IEEEGLOBALSOFTTECHNOLOGIES
 
LECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfd
LECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfdLECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfd
LECT3A (1).PPThhdfghdfhdfghdhdhdfsfdfgsfd
nandemprasanna
 
Formal Method lecture_3 software Engineering.pdf
Formal Method lecture_3 software Engineering.pdfFormal Method lecture_3 software Engineering.pdf
Formal Method lecture_3 software Engineering.pdf
talhaahmad565510
 
debugging - system software
debugging - system softwaredebugging - system software
debugging - system software
Vicky Shan
 
Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17
koolkampus
 
Lecture 11 understanding requirements (3)
Lecture 11   understanding requirements (3)Lecture 11   understanding requirements (3)
Lecture 11 understanding requirements (3)
IIUI
 
Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5
koolkampus
 
software Processes
software Processessoftware Processes
software Processes
Seif Shaame
 
A model for run time software architecture adaptation
A model for run time software architecture adaptationA model for run time software architecture adaptation
A model for run time software architecture adaptation
ijseajournal
 
Maximizing SAP ABAP Performance
Maximizing SAP ABAP PerformanceMaximizing SAP ABAP Performance
Maximizing SAP ABAP Performance
PeterHBrown
 
Aspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSDAspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSD
Can R. PAHALI
 
Software testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationSoftware testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentation
vigneshasromio
 
Ad

More from koolkampus (20)

Local Area Networks in Data Communication DC24
Local Area Networks in Data Communication DC24Local Area Networks in Data Communication DC24
Local Area Networks in Data Communication DC24
koolkampus
 
Bit Oriented Protocols in Data Communication DC23
Bit Oriented Protocols in Data Communication DC23Bit Oriented Protocols in Data Communication DC23
Bit Oriented Protocols in Data Communication DC23
koolkampus
 
Data Link Control in Data Communication DC20
Data Link Control in Data Communication DC20Data Link Control in Data Communication DC20
Data Link Control in Data Communication DC20
koolkampus
 
Error Detection and Correction in Data Communication DC18
Error Detection and Correction in Data Communication DC18Error Detection and Correction in Data Communication DC18
Error Detection and Correction in Data Communication DC18
koolkampus
 
TDM in Data Communication DC16
TDM in Data Communication DC16TDM in Data Communication DC16
TDM in Data Communication DC16
koolkampus
 
Radio Communication Band(Data Communication) DC14
Radio Communication Band(Data Communication) DC14Radio Communication Band(Data Communication) DC14
Radio Communication Band(Data Communication) DC14
koolkampus
 
Connectors in Data Communication DC12
Connectors in Data Communication DC12Connectors in Data Communication DC12
Connectors in Data Communication DC12
koolkampus
 
Transmission of Digital Data(Data Communication) DC11
Transmission of Digital Data(Data Communication) DC11Transmission of Digital Data(Data Communication) DC11
Transmission of Digital Data(Data Communication) DC11
koolkampus
 
Analog to Digital Encoding in Data Communication DC9
Analog to Digital Encoding in Data Communication DC9Analog to Digital Encoding in Data Communication DC9
Analog to Digital Encoding in Data Communication DC9
koolkampus
 
Signal with DC Component(Data Communication) DC7
Signal with DC Component(Data Communication) DC7Signal with DC Component(Data Communication) DC7
Signal with DC Component(Data Communication) DC7
koolkampus
 
Layer Examples in Data Communication CD4
Layer Examples in Data Communication CD4Layer Examples in Data Communication CD4
Layer Examples in Data Communication CD4
koolkampus
 
OSI Model (Data Communication) DC3
OSI Model (Data Communication) DC3OSI Model (Data Communication) DC3
OSI Model (Data Communication) DC3
koolkampus
 
Basic Concepts in Data Communication DC1
Basic Concepts in Data Communication DC1Basic Concepts in Data Communication DC1
Basic Concepts in Data Communication DC1
koolkampus
 
Token Passing in Data Communication DC25
Token Passing in Data Communication DC25Token Passing in Data Communication DC25
Token Passing in Data Communication DC25
koolkampus
 
Data Link Protocols in Data Communication DC22
Data Link Protocols in Data Communication DC22Data Link Protocols in Data Communication DC22
Data Link Protocols in Data Communication DC22
koolkampus
 
Flow Control in Data Communication DC21
Flow Control in Data Communication DC21Flow Control in Data Communication DC21
Flow Control in Data Communication DC21
koolkampus
 
CRC in Data Communication DC19
CRC in Data Communication DC19CRC in Data Communication DC19
CRC in Data Communication DC19
koolkampus
 
Telephone Networn in Data Communication DC17
Telephone Networn in Data Communication DC17Telephone Networn in Data Communication DC17
Telephone Networn in Data Communication DC17
koolkampus
 
Multiplexing in Data Communication DC15
Multiplexing in Data Communication DC15Multiplexing in Data Communication DC15
Multiplexing in Data Communication DC15
koolkampus
 
Transmission Media in Data Communication DC13
Transmission Media in Data Communication DC13Transmission Media in Data Communication DC13
Transmission Media in Data Communication DC13
koolkampus
 
Local Area Networks in Data Communication DC24
Local Area Networks in Data Communication DC24Local Area Networks in Data Communication DC24
Local Area Networks in Data Communication DC24
koolkampus
 
Bit Oriented Protocols in Data Communication DC23
Bit Oriented Protocols in Data Communication DC23Bit Oriented Protocols in Data Communication DC23
Bit Oriented Protocols in Data Communication DC23
koolkampus
 
Data Link Control in Data Communication DC20
Data Link Control in Data Communication DC20Data Link Control in Data Communication DC20
Data Link Control in Data Communication DC20
koolkampus
 
Error Detection and Correction in Data Communication DC18
Error Detection and Correction in Data Communication DC18Error Detection and Correction in Data Communication DC18
Error Detection and Correction in Data Communication DC18
koolkampus
 
TDM in Data Communication DC16
TDM in Data Communication DC16TDM in Data Communication DC16
TDM in Data Communication DC16
koolkampus
 
Radio Communication Band(Data Communication) DC14
Radio Communication Band(Data Communication) DC14Radio Communication Band(Data Communication) DC14
Radio Communication Band(Data Communication) DC14
koolkampus
 
Connectors in Data Communication DC12
Connectors in Data Communication DC12Connectors in Data Communication DC12
Connectors in Data Communication DC12
koolkampus
 
Transmission of Digital Data(Data Communication) DC11
Transmission of Digital Data(Data Communication) DC11Transmission of Digital Data(Data Communication) DC11
Transmission of Digital Data(Data Communication) DC11
koolkampus
 
Analog to Digital Encoding in Data Communication DC9
Analog to Digital Encoding in Data Communication DC9Analog to Digital Encoding in Data Communication DC9
Analog to Digital Encoding in Data Communication DC9
koolkampus
 
Signal with DC Component(Data Communication) DC7
Signal with DC Component(Data Communication) DC7Signal with DC Component(Data Communication) DC7
Signal with DC Component(Data Communication) DC7
koolkampus
 
Layer Examples in Data Communication CD4
Layer Examples in Data Communication CD4Layer Examples in Data Communication CD4
Layer Examples in Data Communication CD4
koolkampus
 
OSI Model (Data Communication) DC3
OSI Model (Data Communication) DC3OSI Model (Data Communication) DC3
OSI Model (Data Communication) DC3
koolkampus
 
Basic Concepts in Data Communication DC1
Basic Concepts in Data Communication DC1Basic Concepts in Data Communication DC1
Basic Concepts in Data Communication DC1
koolkampus
 
Token Passing in Data Communication DC25
Token Passing in Data Communication DC25Token Passing in Data Communication DC25
Token Passing in Data Communication DC25
koolkampus
 
Data Link Protocols in Data Communication DC22
Data Link Protocols in Data Communication DC22Data Link Protocols in Data Communication DC22
Data Link Protocols in Data Communication DC22
koolkampus
 
Flow Control in Data Communication DC21
Flow Control in Data Communication DC21Flow Control in Data Communication DC21
Flow Control in Data Communication DC21
koolkampus
 
CRC in Data Communication DC19
CRC in Data Communication DC19CRC in Data Communication DC19
CRC in Data Communication DC19
koolkampus
 
Telephone Networn in Data Communication DC17
Telephone Networn in Data Communication DC17Telephone Networn in Data Communication DC17
Telephone Networn in Data Communication DC17
koolkampus
 
Multiplexing in Data Communication DC15
Multiplexing in Data Communication DC15Multiplexing in Data Communication DC15
Multiplexing in Data Communication DC15
koolkampus
 
Transmission Media in Data Communication DC13
Transmission Media in Data Communication DC13Transmission Media in Data Communication DC13
Transmission Media in Data Communication DC13
koolkampus
 

Recently uploaded (20)

Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 

Formal Specification in Software Engineering SE9

  • 1. Formal Specification Techniques for the unambiguous specification of software
  • 2. Objectives To explain why formal specification techniques help discover problems in system requirements To describe the use of algebraic techniques for interface specification To describe the use of model-based techniques for behavioural specification
  • 3. Topics covered Formal specification in the software process Interface specification Behavioural specification
  • 4. Formal methods 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
  • 5. 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
  • 6. Use of formal methods Formal methods have limited practical applicability Their principal benefits are in reducing the number of errors in systems so their mai area of applicability is critical systems In this area, the use of formal methods is most likely to be cost-effective
  • 7. Specification in the 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 and semantics.
  • 9. Specification in the software process
  • 10. Specification techniques Algebraic approach The system is specified in terms of its operations and their relationships 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
  • 12. 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
  • 13. Development costs with formal specification
  • 14. Interface specification Large systems are decomposed into subsystems with well-defined interfaces between these subsystems Specification of subsystem interfaces allows independent development of the different subsystems Interfaces may be defined as abstract data types or object classes The algebraic approach to formal specification is particularly well-suited to interface specification
  • 16. The structure of an algebraic specification
  • 17. Specification components Introduction Defines the sort (the type name) and declares other specifications that are used Description Informally describes the operations on the type Signature Defines the syntax of the operations in the interface and their parameters Axioms Defines the operation semantics by defining axioms which characterise behaviour
  • 18. Systematic algebraic specification Algebraic specifications of a system may be developed in a systematic way Specification structuring. Specification naming. Operation selection. Informal operation specification Syntax definition Axiom definition
  • 19. Specification operations Constructor operations. Operations which create entities of the type being specified Inspection operations. Operations which evaluate entities of the type being specified To specify behaviour, define the inspector operations for each constructor operation
  • 20. Operations on a list ADT Constructor operations which evaluate to sort List Create, Cons and Tail Inspection operations which take sort list as a parameter and return some other sort Head and Length. Tail can be defined using the simpler constructors Create and Cons. No need to define Head and Length with Tail.
  • 22. Recursion in specifications Operations are often specified recursively Tail (Cons (L, v)) = if L = Create then Create else Cons (Tail (L), v) Cons ([5, 7], 9) = [5, 7, 9] Tail ([5, 7, 9]) = Tail (Cons ( [5, 7], 9)) = Cons (Tail ([5, 7]), 9) = Cons (Tail (Cons ([5], 7)), 9) = Cons (Cons (Tail ([5]), 7), 9) = Cons (Cons (Tail (Cons ([], 5)), 7), 9) = Cons (Cons ([Create], 7), 9) = Cons ([7], 9) = [7, 9]
  • 23. Interface specification in critical systems Consider an air traffic control system where aircraft fly through managed sectors of airspace Each sector may include a number of aircraft but, for safety reasons, these must be separated In this example, a simple vertical separation of 300m is proposed The system should warn the controller if aircraft are instructed to move so that the separation rule is breached
  • 24. A sector object Critical operations on an object representing a controlled sector are Enter. Add an aircraft to the controlled airspace Leave. Remove an aircraft from the controlled airspace Move. Move an aircraft from one height to another Lookup. Given an aircraft identifier, return its current height
  • 25. Primitive operations It is sometimes necessary to introduce additional operations to simplify the specification The other operations can then be defined using these more primitive operations Primitive operations Create. Bring an instance of a sector into existence Put. Add an aircraft without safety checks In-space. Determine if a given aircraft is in the sector Occupied. Given a height, determine if there is an aircraft within 300m of that height
  • 27. Specification commentary Use the basic constructors Create and Put to specify other operations Define Occupied and In-space using Create and Put and use them to make checks in other operation definitions All operations that result in changes to the sector must check that the safety criterion holds
  • 28. 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
  • 29. The structure of a Z schema
  • 31. Modelling the insulin pump The schema models the insulin pump as a number of state variables reading? dose, cumulative_dose r0, r1, r2 capacity alarm! pump! display1!, display2! Names followed by a ? are inputs, names followed by a ! are outputs
  • 32. Schema invariant Each Z schema has an invariant part which defines conditions that are always true For the insulin pump schema it is always true that The dose must be less than or equal to the capacity of the insulin reservoir No single dose may be more than 5 units of insulin and the total dose delivered in a time period must not exceed 50 units of insulin. This is a safety constraint (see Chapters 16 and 17) display1! shows the status of the insulin reservoir.
  • 34. The dosage computation The insulin pump computes the amount of insulin required by comparing the current reading with two previous readings If these suggest that blood glucose is rising then insulin is delivered Information about the total dose delivered is maintained to allow the safety check invariant to be applied Note that this invariant always applies - there is no need to repeat it in the dosage computation
  • 36. Output schemas The output schemas model the system displays and the alarm that indicates some potentially dangerous condition The output displays show the dose computed and a warning message The alarm is activated if blood sugar is very low - this indicates that the user should eat something to increase their blood sugar level
  • 38. Schema consistency It is important that schemas are consistent. Inconsistency suggests a problem with the system requirements The INSULIN_PUMP schema and the DISPLAYare inconsistent display1! shows a warning message about the insulin reservoir (INSULIN_PUMP) display1! Shows the state of the blood sugar (DISPLAY) This must be resolved before implementation of the system
  • 39. 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
  • 40. Key points Formal specification techniques are most applicable in the development of critical systems and standards. Algebraic techniques are suited to interface specification where the interface is defined as a set of object classes Model-based techniques model the system using sets and functions. This simplifies some types of behavioural specification