Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor.

Slides:



Advertisements
Similar presentations
Formal Specifications
Advertisements

1 Note content copyright © 2004 Ian Sommerville. NU-specific content © 2004 M. E. Kabay. All rights reserved. Formal Specification IS301 – Software Engineering.
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn 2.4 The Z Notation [Reference: M. Spivey: The Z Notation, Prentice Hall]
Configuration management
Configuration management
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
25 February 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department.
The Z Specification Language
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Object Oriented Design An object combines data and operations on that data (object is an instance of class) data: class variables operations: methods Three.
Formal Specification - Techniques for the unambiguous specification of software Objectives: To explain why formal specification techniques help discover.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
Software Requirements
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
SWE Introduction to Software Engineering
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 10 Slide 1 Formal Specification.
©Ian Sommerville 2004Software Engineering, 7th edition. Insulin Pump Slide 1 An automated insulin pump.
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
©Ian Sommerville 2006Critical Systems Slide 1 Critical Systems Engineering l Processes and techniques for developing critical systems.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Critical Systems Specification 3 Formal Specification.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
An example of a critical system
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
3- System modelling An architectural model presents an abstract view of the sub-systems making up a system May include major information flows between.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Formal Specification l Techniques for the unambiguous specification of software.
Spreadsheet-Based Decision Support Systems Chapter 22:
Chapter 4 – Requirements Engineering
المحاضرة الثالثة. Software Requirements Topics covered Functional and non-functional requirements User requirements System requirements Interface specification.
©Ian Sommerville 2000Software Engineering, Chapter 10 Slide 1 Chapter 10 Formal Specification.
Chapter 1 Introduction.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Chapter 9 Formal Specifications.
Software Design Deriving a solution which satisfies software requirements.
WXGE6103 Software Engineering Process and Practice Formal Specification.
Requirements Engineering Methods for Requirements Engineering Lecture-30.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 9 Slide 1 Critical Systems Specification 1.
SWEN 5130Requirements Engineering Algebraic Specification Slide 1 Algebraic Specification u Specifying abstract types in terms of relationships between.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor.
Figures – Chapter 15. Figure 15.1 Model checking.
Notes on: Is Proof More Cost- Effective Than Testing? by Steve King, Jonathan Hammond, Rob Chapman, Andy Pryor Prepared by Stephen M. Thebaut, Ph.D. University.
Version 02U-1 Computer Security: Art and Science1 Correctness by Construction: Developing a Commercial Secure System by Anthony Hall Roderick Chapman.
©Ian Sommerville 2000Software Engineering, Chapter 10 Slide 1 Chapter 10 Formal Specification.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
CS/ENGRD 2110 FALL 2013 Lecture 3: Fields, getters and setters, constructors, testing 1.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
An insulin pump. Needle Assembly: Connected to pump. Component used to deliver insulin into the diabetic body.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VII. System Specification (I)
Pepper modifying Sommerville's Book slides
IS301 – Software Engineering V:
Formal Specification.
Algorithms and Problem Solving
(State) Model-Based Approaches II Software Specification Lecture 36
About the Presentations
Chapter 27 Formal Specification.
Formal Specifications
Software testing.
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Algorithms and Problem Solving
Algebraic Specification Software Specification Lecture 34
Activities of Formal Methods
Presentation transcript:

Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor

Objectives l To explain why formal specification techniques help discover problems in system requirements l To describe the use of algebraic techniques for interface specification l To describe the use of model-based techniques for behavioural specification

Topics covered l Formal specification in the software process l Sub-system interface specification l Behavioural specification

Interface specification in critical systems l Consider an air traffic control system where aircraft fly through managed sectors of airspace. l Each sector may include a number of aircraft but, for safety reasons, these must be separated. l In this example, a simple vertical separation of 300m is proposed. l The system should warn the controller if aircraft are instructed to move so that the separation rule is breached.

A sector object l 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 l It is sometimes necessary to introduce additional operations to simplify the specification. l The other operations can then be defined using these more primitive operations. l 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 (1)

Sector specification (2)

Specification commentary l Use the basic constructors Create and Put to specify other operations. l Define Occupied and In-space using Create and Put and use them to make checks in other operation definitions. l All operations that result in changes to the sector must check that the safety criterion holds.

Behavioural specification l Algebraic specification can be cumbersome when the object operations are not independent of the object state. l Model-based specification exposes the system state and defines the operations in terms of changes to that state. l 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

Modelling the insulin pump l The Z schema for the insulin pump declares a number of state variables including: Input variables such as switch? (the device switch), InsulinReservoir? (the current quantity of insulin in the reservoir) and Reading? (the reading from the sensor); Output variables such as alarm! (a system alarm), display1!, display2! (the displays on the pump) and dose! (the dose of insulin to be delivered).

Schema invariant l Each Z schema has an invariant part which defines conditions that are always true. l 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 4 units of insulin and the total dose delivered in a time period must not exceed 25 units of insulin. This is a safety constraint; display2! shows the amount of insulin to be delivered.

Insulin pump schema

State invariants

The dosage computation l The insulin pump computes the amount of insulin required by comparing the current reading with two previous readings. l If these suggest that blood glucose is rising then insulin is delivered. l Information about the total dose delivered is maintained to allow the safety check invariant to be applied. l Note that this invariant always applies - there is no need to repeat it in the dosage computation.

RUN schema (1)

RUN schema (2)

Sugar OK schema

Key points l Formal system specification complements informal specification techniques. l Formal specifications are precise and unambiguous. They remove areas of doubt in a specification. l 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. l Formal specification techniques are most applicable in the development of critical systems and standards.

Key points l Algebraic techniques are suited to interface specification where the interface is defined as a set of object classes. l Model-based techniques model the system using sets and functions. This simplifies some types of behavioural specification. l Operations are defined in a model-based spec. by defining pre and post conditions on the system state.