Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 501: Software Engineering Fall 1999

Similar presentations


Presentation on theme: "CS 501: Software Engineering Fall 1999"— Presentation transcript:

1 CS 501: Software Engineering Fall 1999
Lecture 8 Formal Specification II

2 Administration Assignment 2: Instructions for submitting Assignment 2

3 Schemas Schema:  The basic unit of formal specification.
 Describes admissible states and operations of a system.

4 LibSys: An Example of Z Library system:  Stock of books
 Registered users.  Each copy of a book has a unique identifier.  Some books on loan; other books on shelves available for loan.  Maximum number of books that any user may have on loan.

5 LibSys: Operations  Issue a copy of a book to a reader.
 Reader return a book.  Add a copy to the stock.  Remove a copy from the stock.  Inquire which books are on loan to a reader.  Inquire which readers has a particular copy of a book.  Register a new reader.  Cancel a reader's registration.

6 LibSys Level of Detail: Assume given sets: Copy, Book, Reader
Global constant: maxloans

7 Domain and Range ran m X dom m Y y x m : X Y
dom m = { x  X :  y  Y  x y} ran m = { y  Y :  x  X  x y}

8 LibSys: Schema for Abstract States
Library stock : Copy Book issued : Copy Reader shelved : F Copy readers: F Reader shelved  dom issued = dom stock shelved  dom issued = Ø ran issued  readers r : readers • #(issued  {r}) maxloans <

9 Schema Inclusion LibDB stock : Copy Book readers: F Reader LibLoans
issued : Copy Reader shelved : F Copy r : Reader • #(issued  {r}) maxloans shelved  dom issued = Ø <

10 Schema Inclusion (continued)
Library LibDB LibLoans dom stock = shelved  dom issued ran issued  readers

11 Schemas Describing Operations
Naming conventions for objects: Before: plain variables, e.g., r After: with appended dash, e.g., r' Input: with appended ?, e.g., r? Output: with appended !, e.g., r!

12 Operation: Issue a Book
 Inputs: copy c?, reader r?  Copy must be shelved initially: c?  shelved  Reader must be registered: r?  readers  Reader must have less than maximum number of books on loan: #(issued  {r?}) < maxloans  Copy must be recorded as issued to the reader: issued' = issued  {c? r?}  The stock and the set of registered readers are unchanged: stock' = stock; readers' = readers

13 Operation: Issue a Book
stock, stock' : Copy Book issued, issued' : Copy Reader shelved, shelved': F Copy readers, readers' : F Reader c?: Copy; r? :Reader [See next slide]

14 Operation: Issue a Book (continued)
[See previous slide] shelved  dom issued = dom stock shelved'  dom issued' = dom stock' shelved  dom issued = Ø; shelved'  dom issued' = Ø ran issued  readers; ran issued'  readers' r : readers  #(issued  {r}) maxloans r : readers'  #(issued'  {r}) maxloans c?  shelved; r?  readers; #(issued  {r?}) < maxloans issued' = issued  {c? r?} stock' = stock; readers' = readers < <

15 Schema Decoration Issue Library Library' c? : Copy; r? : Reader
c?  shelved; r?  readers #(issued  {r?}) < maxloans issued' = issued  {c? r?} stock' = stock; readers' = readers

16 Schema Decoration Issue Library c? : Copy; r? : Reader
c?  shelved; r?  readers #(issued  {r?}) < maxloans issued' = issued  {c? r?} stock' = stock; readers' = readers

17 The Schema Calculus Schema inclusion Schema decoration
Schema disjunction: AddCopy AddKnownTitle  AddNewTitle Schema conjunction: AddCopy EnterNewCopy  AddCopyAdmin Schema negation Schema composition = ^ = ^

18 Requirements Definition and Analysis
System and Software design Implementation and Unit Testing Integration and System Testing Operation and Maintenance

19 The Requirements Process
Feasibility Study Requirements Analysis Requirements Definition Requirements Specification Feasibility Report System Models Definition of Requirements Requirements Document Specification of Requirements


Download ppt "CS 501: Software Engineering Fall 1999"

Similar presentations


Ads by Google