Chapter 25 Formal Methods. BASIC CONCEPTS A method is formal if it has a sound mathematical basis, typically given by a formal specification language.

Slides:



Advertisements
Similar presentations
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advertisements

Software Requirements
Control Structures Any mechanism that departs from straight-line execution: –Selection: if-statements –Multiway-selection: case statements –Unbounded iteration:
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Computers Are Your Future
Unified Modeling Language
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
System Concepts for Process Modeling  Process Concepts  Process Logic  Decomposition diagrams and data flow diagrams will prove very effective tools.
Introduction to Formal Methods
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Formal Methods. Importance of high quality software ● Software has increasingly significant in our everyday activities - manages our bank accounts - pays.
Software Testing and Quality Assurance
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Simulation.
Software Requirements
Programming Languages Structure
Developed by Robert Olson Chapter 28 Formal Methods.
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
1 Introduction to Formal Methods Introduction to Formal Methods; Preconditions, Postconditions, and Invariants Revisited; Z language Example (Pressman)
Describing Syntax and Semantics
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Fundamentals of Python: From First Programs Through Data Structures
1 These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.
Programming Languages
Fundamentals of Python: First Programs
Syntax & Semantic Introduction Organization of Language Description Abstract Syntax Formal Syntax The Way of Writing Grammars Formal Semantic.
Formal Methods CIS 376 Bruce R. Maxim UM-Dearborn.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Formal Specification l Techniques for the unambiguous specification of software.
1 The Architectural Design of FRUIT: A Family of Retargetable User Interface Tools Yi Liu, H. Conrad Cunningham and Hui Xiong Computer & Information Science.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1 Software Requirements l Descriptions and specifications of a system.
1 COSC 4406 Software Engineering COSC 4406 Software Engineering Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Nipissing University, 100.
Computer Science School of Computing Clemson University Introduction to Formal Specification Murali Sitaraman Clemson University.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Software Requirements Presented By Dr. Shazzad Hosain.
Chapter 3 – Set Theory  .
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Prepared By Ms.R.K.Dharme Head Computer Department.
Introduction to Computer Programming Using C Session 23 - Review.
WXGE6103 Software Engineering Process and Practice Formal Specification.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Requirements Engineering Methods for Requirements Engineering Lecture-30.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
L To identify the services that the customer requires from a system and the constraints under which it operates and is developed.
Formal Methods in Software Engineering “And they made their lives bitter with hard bondage … all their service … was with rigour.” Ex 1:14.
Formal Methods in SE Software Verification Using Formal Methods By: Qaisar Javaid, Assistant Professor Formal Methods1.
Software Engineering 2 -Prakash Shrestha.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Requirements Engineering Methods for Requirements Engineering Lecture-31.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
1 Software Requirements Descriptions and specifications of a system.
FG Group -Afrilia BP -Liana F.B.I -Maulidatun Nisa -Riza Amini F.
Formal Specification.
Presentation on Software Requirements Submitted by
1-1 Logic and Syntax A computer program is a solution to a problem.
DDC 1023 – Programming Technique
GC211Data Structure Lecture2 Sara Alhajjam.
CS 326 Programming Languages, Concepts and Implementation
Organization of Programming Languages
B (The language of B-Method )
Programming Right from the Start with Visual Basic .NET 1/e
Chapter 28 Formal Modeling and Verification
Chapter 15 Functional Programming 6/1/2019.
Presentation transcript:

Chapter 25 Formal Methods

BASIC CONCEPTS A method is formal if it has a sound mathematical basis, typically given by a formal specification language. This basis provides a means of precisely defining notions like consistency and completeness, and more relevantly, specification, implementation and correctness. Deficiencies of Less Formal Approaches – Contradictions are sets of statements that are at variance with each other. – Ambiguities are statements that can be interpreted in a number of ways. – Vagueness often occurs because a system specification is a very bulky document. – Incompleteness is probably one of the most frequently occurring problems with system specifications.

– Mixed levels of abstraction occur when very abstract statements are intermixed randomly with statements that are at a much lower level of detail Mathematics in Software Development Formal Methods Concepts

A symbol Table: – The data invariant that holds for the symboltable just discussed has two components: – that the table will contain no more than MaxIds names. – that there will be no duplicate names in the table.

Example 2: A Block Handler One of the more important parts of a computer's operating system is the subsystem that maintains files created by users. Part of the filing subsystem is the block handler.

For this subsystem the state is the collection of free blocks, the collection of used blocks, and the queue of returned blocks.

The data invariant, expressed in natural language, is – No block will be marked as both unused and used. – All the sets of blocks held in the queue will be subsets of the collection of – currently used blocks. – No elements of the queue will contain the same block numbers. – The collection of used blocks and blocks that are unused will be the total collection of blocks that make up files. – The collection of unused blocks will have no duplicate block numbers. – The collection of used blocks will have no duplicate block numbers.

Example : A Print Spooler

The state of the spooler is represented by the four components: queues, output, devices, limits, and sizes The data invariant has five components: – Each output device is associated with an upper limit on print lines. – Each output device is associated with a possibly nonempty queue of files awaiting printing. – Each file is associated with a size. – Each queue associated with an output device contains files that have a size less than the upper limit of the output device. – There will be no more than MaxDevs output devices administered by the spooler.

MATHEMATICAL PRELIMINARIES Sets and Constructive Specification – The elements contained within a set are unique {C++, Pascal, Ada, COBOL, Java} – The order in which the elements appear within a set is immaterial #{A, B, C, D} = 4 The second approach is to create a constructive set specification. The general form of the members of a set is specified using a Boolean expression. Constructive set specification is preferable to enumeration because it enables a succinct definition of large sets. It also explicitly defines the rule that was used in constructing the set. Consider the following constructive specification example: Set Operators – The operator is used to indicate membership of a set. x e X

Logic Operators – Sequences A sequence s is a set of pairs whose elements range from 1 to the highestnumber element. – {(1, Jones), (2, Wilson), (3, Shapiro), (4, Estavez)}

APPLYING MATHEMATICAL NOTATION FOR FORMAL SPECIFICATION FORMAL SPECIFICATION LANGUAGES – a syntax that defines the specific notation with which the specification is represented, – semantics to help define a "universe of objects" that will be used to describe the system – a set of relations that define the rules that indicate which objects properly satisfy the specification. USING Z TO REPRESENT AN EXAMPLE SOFTWARE COMPONENT – Z specifications are structured as a set of schemas—a boxlike structure that introduces variables and specifies the relationship between these variables.

THE TEN COMMANDMENTS OF FORMAL METHODS Thou shalt choose the appropriate notation Thou shalt formalize but not overformalize Thou shalt estimate costs Thou shalt have a formal methods guru on call Thou shalt not abandon thy traditional development methods Thou shalt document sufficiently

Thou shalt not compromise thy quality standards Thou shalt not be dogmatic Thou shalt test, test, and test again Thou shalt reuse