CS 501: Software Engineering Fall 1999

Slides:



Advertisements
Similar presentations
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 29.
Advertisements

CS 501: Software Engineering Fall 2000 Lecture 10 Formal Specification.
Algorithms and Problem Solving
Computer Science 101 Overview of Algorithms. Example: Make Pancakes Prepare batter Beat 2 eggs Add 1 tablespoon of brown sugar Add 1 cup of milk Add 2.
CS Sept Your first C++ program… Boilerplate // Cannon, demo program #include using namespace std; int main() {// program goes here… return.
1 CS 501 Spring 2008 CS 501: Software Engineering Lecture 10 Requirements 3.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 12 Requirements IV.
1 CS 501 Spring 2006 CS 501: Software Engineering Lecture 10 Requirements 4.
1 CS 501 Spring 2005 CS 501: Software Engineering Lecture 10 Requirements 4.
CS211 Data Structures Sami Rollins Fall 2004.
1 CS 501 Spring 2007 CS 501: Software Engineering Lecture 10 Requirements 4.
C SC 520 Principles of Programming Languages 1 C SC 520: Principles of Programming Languages Peter J. Downey Department of Computer Science Spring 2006.
More about Numerical Computation CS-2301, B-Term More about Numerical Computation CS-2301, System Programming for Non-Majors (Slides include materials.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
CS CS 5150 Software Engineering Lecture 10 Requirements 3.
CS CS 5150 Software Engineering Lecture 10 Requirements 3.
1 CS 501 Spring 2006 CS 501: Software Engineering Lecture 9 Requirements 3.
Course: Software Engineering © Alessandra RussoUnit 1 - Introduction, slide Number 1 Unit 1: Introduction Course: C525 Software Engineering Lecturer: Alessandra.
EE 3561_Unit_1(c)Al-Dhaifallah EE 3561 : - Computational Methods in Electrical Engineering Unit 1: Introduction to Computational Methods and Taylor.
Chapter 3 COMPLETING THE BASICS Programming Fundamentals with C++1.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 10 Techniques for Requirements Definition and Specification II.
Lecture 2 Introduction to Computer Programming CUIT A.M. Gamundani Presentation Layout Data types.
CS CS 5150 Software Engineering Lecture 10 Requirements 3.
CSCI 125 & 161 Lecture 13 Martin van Bommel. Floating Point Data Floating point numbers are not exact Value 0.1 in binary is very close to 1/10, but not.
Input, Output, and Processing
Programming Paradigms Backus Naur Form and Syntax Diagrams.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Lecture 3 Introduction to Computer Programming CUIT A.M. Gamundani Presentation Layout from Lecture 1 Background.
1 CS 501 Spring 2004 CS 501: Software Engineering Lecture 9 Requirements 3.
The Hashemite University Computer Engineering Department
Textbook C for Scientists and Engineers © Prentice Hall 1997 Available at NUS CO-OP at S$35.10.
Sahar Mosleh California State University San MarcosPage 1 Finite State Machine.
CS223: Software Engineering
9/15/2010CS485, Lecture 2, Fall Lecture 2: Introduction to Syntax (Revised based on the Tucker’s slides)
1 Specification A broad term that means definition Used at different stages of software development for different purposes Generally, a statement of agreement.
CS 5150 Software Engineering Lecture 9 Requirements 3.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 11 Requirements III.
CS 501: Software Engineering Fall 1999 Lecture 23 Design for Usability I.
UML for design: Class Diagrams ENGR 110 #
CompSci 280 S Introduction to Software Development
Topics Designing a Program Input, Processing, and Output
Assembly Language for x86 Processors 6th Edition
Functions Domain and Range.
ECE 353 Lab 3 Pipeline Simulator
1.3 Finite State Machines.
Dr. Eng Amr T. Abdel-Hamid
C++ Basic Syntax – Homework Exercises
ICS103 Programming in C Lecture 3: Introduction to C (2)
State Transition Diagram for A System
CS251 – Software Engineering Lectures 11 State Diagrams
Algorithm and Ambiguity
Department of Software & Media Technology
Introduction to the C Language
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
More about Numerical Computation
Chapter 1: An Overview of Computers and Programming Languages
Programming Funamental slides
Welcome to Ms. Seshadri’s Algebra Class
Course websites CS201 page link at my website: Lecture slides
Algorithm and Ambiguity
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
October 29 Review for 2nd Exam Ask Questions! 4/26/2019
Basic Concepts of Algorithm
COMPUTER HISTORY, PRESENT & FUTURE. What is a Computer? A computer is a machine that can be instructed to carry out sequences of arithmetic or logical.
Presentation transcript:

CS 501: Software Engineering Fall 1999 Lecture 7 Formal Specification I

Administration Assignment 2: Instructions for submitting Assignment 2 Ownership of software in projects: Students are owners of work that is carried out in projects (except patents) Importance of clarity at beginning of projects

Example from Lecture 6 Edit Unit 4

Example from Lecture 6 Edit Unit 4

Formal Specification Why?  Precise standard to define and validate software. Why not?  May be time consuming  Methods not suitable for all applications

Formal Specification Ben Potter, Jane Sinclair, David Till, An Introduction to Formal Specification and Z (Prentice Hall) 1991 Jonathan Jacky The Way of Z (Cambridge University Press) 1997

Mathematical Specification B1, B2, ... Bk is a sequence of m x m matrices 1, 2, ... k is a sequence of m x m elementary matrices B1-1 = 1 B2-1 = 21 Bk-1 = k ... 21 The numerical accuracy must be such that, for all k, BkBk-1 - I < 

Specification of Programming Languages <unsigned number> ::= <unsigned integer> | <unsigned real> <unsigned integer> ::= <digit> {<digit>} <unsigned real> ::= <unsigned integer> . <digit> {<digit>} | <unsigned integer> . <digit> {<digit>} E <scale factor> | <unsigned integer> E <scale factor> <scale factor> ::= <unsigned integer> | <sign> <unsigned integer> <sign> ::= + | - Pascal number syntax

Formal Specification Using Diagrams unsigned integer digit unsigned number + unsigned integer . digit E unsigned integer -

Two Rules  Formal specification does not guarantee correctness  Formal specification does not prescribe the implementation

Example: Specification Informal: The function intrt(a) returns the largest integer whose square is less than or equal to a. Formal (Z): intrt: N N a : N • intrt(a) * intrt(a) < a < (intrt(a) + 1) * (intrt(a) + 1)

Example: Algorithm 1 + 3 + 5 + ... (2n - 1) = n2

Example: Program int intrt (int a) /* Calculate integer square root */ { int i, term, sum; term = 1; sum = 1; for (i = 0; sum <= a; i++) term = term + 2; sum = sum + term; } return i;

Finite State Machine A broadly used method of formal specification:  Event driven systems (e.g., games)  User interfaces  Protocol specification etc., etc., ...

Finite State Machine Example: Therapy control console [informal description]

State Transition Diagram Select field Enter Enter (ok) Start Beam on Patients Fields Setup Ready Stop (interlock) Select patient

State Transition Table Select Patient Select Field Enter ok Start Stop interlock Patients Fields Fields Patients Setup Setup Patients Fields Ready Beam on Ready Patients Fields Setup Beam on Ready Setup

Z Specification STATE ::= patients | fields | setup | ready | beam_on EVENT ::= select_patient | select_field | enter | start | stop | ok | interlock FSM == (STATE X EVENT) STATE no_change, transitions, control : FSM Continued on next slide

Z Specification (continued) control = no_change transitions no_change = { s : STATE; e : EVENT • (s, e) s } transitions = { (patients, enter) fields, (fields, select_patient) patients, (fields, enter) setup, (setup, select_patient) patients, (setup, select_field) fields, (setup, ok) ready, (ready, select_patient) patients, (ready, select_field) fields, (ready, start) beam_on, (ready, interlock) setup, (beam_on, stop) ready, (beam_on, interlock) setup }

Reading Before next Tuesday, read and be ready to discuss: Sommerville: Chapter11, pages 171 to 206.