CS 501: Software Engineering Fall 1999 Lecture 8 Formal Specification II
Administration Assignment 2: Instructions for submitting Assignment 2
Schemas Schema: The basic unit of formal specification. Describes admissible states and operations of a system.
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.
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.
LibSys Level of Detail: Assume given sets: Copy, Book, Reader Global constant: maxloans
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}
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 <
Schema Inclusion LibDB stock : Copy Book readers: F Reader LibLoans issued : Copy Reader shelved : F Copy r : Reader • #(issued {r}) maxloans shelved dom issued = Ø <
Schema Inclusion (continued) Library LibDB LibLoans dom stock = shelved dom issued ran issued readers
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!
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
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]
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 < <
Schema Decoration Issue Library Library' c? : Copy; r? : Reader c? shelved; r? readers #(issued {r?}) < maxloans issued' = issued {c? r?} stock' = stock; readers' = readers
Schema Decoration Issue Library c? : Copy; r? : Reader c? shelved; r? readers #(issued {r?}) < maxloans issued' = issued {c? r?} stock' = stock; readers' = readers
The Schema Calculus Schema inclusion Schema decoration Schema disjunction: AddCopy AddKnownTitle AddNewTitle Schema conjunction: AddCopy EnterNewCopy AddCopyAdmin Schema negation Schema composition = ^ = ^
Requirements Definition and Analysis System and Software design Implementation and Unit Testing Integration and System Testing Operation and Maintenance
The Requirements Process Feasibility Study Requirements Analysis Requirements Definition Requirements Specification Feasibility Report System Models Definition of Requirements Requirements Document Specification of Requirements