© E. Börger: Ground Model Exercises 1 Exercises in Capturing Requirements Constructing Ground Models ATM (Cash Machine) Vending Machine Password Change.

Slides:



Advertisements
Similar presentations
Chapter 4: Requirements Engineering
Advertisements

© Egon Börger: Linked List 1 Double Linked Lists : Desired Operations Define an ASM which offers the following operations, predicates and functions on.
Use Case Diagrams Damian Gordon.
Chapter 3 Process Description and Control
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Use Case & Use Case Diagram
ATM Security Requirements & Specification Decomposition Team B: Martijn Christiaan Vasilis Benjamin.
 Copyright I/O International, 2013 Visit us at: A Feature Within from Vendor Payment Terms User Friendly Maintenance 
1COM6030 Systems Analysis and Design © University of Sheffield 2005 COM 6030 Software Analysis and Design Lecture 7 – More on use cases and activity diagrams.
Using Your Voic M6 Release 7.1Business Feature Set Default Menu Options Revised August 31, 2007 TR
ATM Case Study A Discussion.
Substitute FAQs SubFinder Overview. FAQs Do I have to have touch-tone service to use SubFinder? No, but you do need a telephone that can be switched from.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Sequence Diagrams. Introduction A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Finite state machines.
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
ATM User Interface Design. Requirements A bank customer is able to access his or her account using an automatic teller machine. To be able to use an ATM.
Interaction Diagrams Activity Diagram State Machine Diagram
Control Panel Overview Key pad: A Qwerty Keypad, used to enter an address. Programmable Features: The programmable features allow you to program.
Introduction to Computability Theory
Use Case modelling 3 How to go from a diagram to a further definition.
CS 582 / CMPE 481 Distributed Systems Fault Tolerance.
© Egon Börger: Lift 1 Lift Control (N.Davis, 1984) The Problem Design the logic to move n lifts bw m floors, and prove it to be well functioning, where.
Object Oriented Analysis Process
Advanced Tool Management Information Module Advanced Tool Management Information Module.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Chapter 1 Program Design
Information for students Welcome to the S 3 P system. Login to the system by entering your User ID and password. The User ID is the same as your normal.
TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 9 Car Payment Calculator Application Introducing the Do While...Loop and Do Until...Loop.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
Fundamentals of Python: From First Programs Through Data Structures Chapter 14 Linear Collections: Stacks.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Interaction Modeling. Introduction (1) Third leg of the modeling tripod. It describes interaction within a system. The class model describes the objects.
Oracle Data Integrator Procedures, Advanced Workflows.
SFWR ENG 3KO4 Software Development for Computer/Electrical Engineering Fall 2009 Instructor: Dr. Kamran Sartipi Software Requirement Specification (SRS)
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Communicating Real-Time State Machines (CRSM) State machines that communicate synchronously Unique unidirectional channels are used for the communication.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
Online Catalog Tutorial. Introduction Welcome to the Online Catalog Tutorial. This is the place to find answers to all of your online shopping questions.
Concurrency Properties. Correctness In sequential programs, rerunning a program with the same input will always give the same result, so it makes sense.
1 eCoRepair New Release Slide Expanded view of Circuit Details Change to Circuit Looping text4 View of closed faults up to 30 days old5 - 7 Minor.
Contract Invoice Guide
Sequencers SQO,SQC,SQL.
1 Work Orders. 2 Generating a Work Order There are two methods to generating a Work Order in the WYNNE STSTEM. First method: Option 11 – 12 – 13 * Open.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Page ADP PearsonAccess Proctor Training. Page Agenda Test Overview Testing Components Proctor Roles and Responsibilities Overview Administering the Test.
UC Diagram & Scenario RKPL C & D. Using Use Case Diagram Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Using Use Case Diagrams
Queues.
State Machine Model.
Object-Oriented Static Modeling of the Banking System - I
Pushdown Automata.
Introduction To Flowcharting
Introduction to Data Structure
Object Oriented Design Model
Expense Report Training
SAD ::: Spring 2018 Sabbir Muhammad Saleh
To the ETS – PNG Continuation: Online Training Course
Using Use Case Diagrams
Interaction Modeling Extracted from textbook:
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Test Design Techniques Software Testing: IN3240 / IN4240
Presentation transcript:

© E. Börger: Ground Model Exercises 1 Exercises in Capturing Requirements Constructing Ground Models ATM (Cash Machine) Vending Machine Password Change Alarm Clock Invoice System Lift Telephone Exchange Double Linked Lists Railroad Crossing Stack Machine Managing Car Rental

© E. Börger: Ground Model Exercises 2 Simple ATM (Cash Machine) : Problem Description Design an ATM, and show it to be well functioning, where the customer is allowed to perform the following ops: –Enter the ID. Only one attempt is allowed per session, upon failure the card is withdrawn. –Withdraw money from the account. Only one attempt is allowed per session. A warning is issued if the amount required exceeds the balance of the account. –Ask for the balance of the account. Allowed only before attempting to withdraw money. The central system (supposed to be designed separately) receives the information about every withdrawel and updates the account balance correspondingly. –The customer is not allowed to do any other transaction before this update has become effective.

© E. Börger: Ground Model Exercises 3 Vending Machine : Problem Description Design the control for a ticket vending machine with –a coin buffer to temporarily hold money input, a coin tray for money return, a coin store where cashed money is stored –a ticket store holding tickets, a ticket tray where to output tickets –user operations to choose one among a finite number of possible tickets input the money requested by the system for the chosen ticket cancel the operations done so far & ask for money return Refine the machine by allowing a choice of the language for communication with the machine more than one ticket to be chosen in one user operation to insert coins and paper money in portions return of overpaid money

© E. Börger: Ground Model Exercises 4 Password Change : Problem Description Design a pgm, and show it to be well functioning, which allows a customer to change his password using the following sequence of operations: –Enter the user ID and the (current) password. Access should be refused if the ID or the password is incorrect. –Enter twice the new password. The new password request should be rejected if the new password is sytnactically incorrect or not correctly repeated. Otherwise the new password should be stored as valid password from now on. Refine Password Change by character typing input submachines Refine Password Change by restricting attempts to define new pwd

© E. Börger: Ground Model Exercises 5 Simple Alarm Clock : Problem Description Design an alarm clock, which automatically every second updates & displays currtime, and allows setting of currtime or alarm time (hour, minute) by the user. –currtime is displayed at each update – to initiate (re)setting curr/alarm time, the user pushes a “time”/”alarm” button –the clock, upon reaching the alarm time, rings until either the user cancels the alarm by pressing the “alarm stop” button or 30 seconds have elapsed execution of ring may be made dependable upon the position of an alarm-on/off-button, to be set by the user Refine the alarm to provide for 3 consecutive ringings with an interval of 5 minutes betweeen them

© E. Börger: Ground Model Exercises 6 Incremental Machine Design: Invoice System J-R Abrial: B-Book, 1996 Specify a one-user system to handle invoices for orders from clients, and to accordingly maintain the record of products (prices and availability in stock), showing also how to incorporate subsystems for error detection and statistics. Refine the spec by specifying also an appropriate GUI. –The system should provide a (“for change” ) extendable set of operations including the following ones (see details below) : creating/modifying products, clients, invoices reporting errors in handling products, invoices, clients retrieving information on clients, products, invoices and their past –For customers’ inspection, use abstract & application domain oriented ops, refinable by more detailed equivalent ops Illustrate the restrictions of the “one-user one-operation per time system” wrt a asynchronous multiple-user version

© E. Börger: Ground Model Exercises 7 Invoice System: Informal Description (cont’d) Invoices are issued to clients and have a discount (percentage of the total) and a maximum allowance, both defined upon invoice creation from corresponding attributes of the client. Invoices have a set of positions (e.g. lines), one per ordered product, holding the product’s unit price (taken upon creation of the position from the price of the product) & the ordered quantity. Clients are classified (e.g. into normal, friend, dubious), yielding a discount (per category), and have a maximum allowance which is applied to each of their invoices. Products have price, status (available, sold out), possibly a substitute (another product guaranteed not to be sold out).

© E. Börger: Ground Model Exercises 8 Invoice System: Required Properties Provide an error report when, upon inserting a new product (or its substitute) or upon incrementing its quantity in an invoice: –the product is sold out and there is no available substitute –the maximum invoice allowance (of the discounted total) would be exceeded by adding the product (or its substitute) to the inv Report parameter type errors which may occur in particular when named rules are called Prove that the system satisfies the following conditions: a sold out product is never made part of an invoice, the system will automatically replace it by its substitute (if there exists one) friend clients (nobody else) get a discount (the same for all), no invoice is ever made for dubious clients (discounted) total of an invoice  maximum invoice allowance no invoice lists an ordered product more than once

© E. Börger: Ground Model Exercises 9 Lift Control (N.Davis, 1984; see J-R Abrial: B-Book, 1996) : The Problem Design the logic to move n lifts bw m floors, and prove it to be well functioning, where –Each lift has for each floor one button which, if pressed, causes the lift to visit (i.e. move to and stop at) that floor. –Each floor (except ground and top) has two buttons to request an up-lift and a down-lift. They are cancelled when a lift visits the floor and is either travelling in the desired direction, or visits the floor with no requests outstanding. In the latter case,if both floor request buttons are illuminated, only one should be cancelled. –A lift without requests should remain in its final destination and await further requests. –Each lift has an emergency button which, if pressed, causes a warning to be sent to the site manager. The lift is then deemed ‘out of service’. Each lift has a mechanism to cancel its ‘out of service’ status.

© E. Börger: Ground Model Exercises 10 Telephone Exchange: Status of Subscribers J-R Abrial: B-Book, 1996 The system controls a network through which pairs among a set of subscribers establish & clear phone conversations Subscribers at each moment are in one status out of: –free (neither engaged in, nor attempting, any phone convers) –unavailable due to a timeout or an unsuccessful attempt to call –initiator status : attempting-init attempting to call somebody by dialing his number waiting-init waiting for somebody to answer, after having been connected speaking-init speaking to the called subscriber –recipient status : waiting-recip being connected: phone ringing or conversation suspended speaking-recip speaking to the initiator of the phone conversation

© E. Börger: Ground Model Exercises 11 Telephone Exchange: System & Subscriber Operations Free Subscribers can Lift their handset, thus becoming attempting initiators. In every initiator state, initiators (& only them) can Clear their call, thus becoming again free. Initiators in attempting status can Dial, trying to complete a subscriber’s number. The system can MakeUnavailable an initiator, due to a timeout, or due to an unsuccessful attempt to call because of WrongNumber or Failure (called subscriber not free). The system can Connect an initiator and a free recipient, making them both waiting (for the recipient to answer). A recipient can Answer and Suspend a phone call.

© E. Börger: Ground Model Exercises 12 Double Linked Lists : Desired Operations Define an ASM which offers the following operations, predicates and functions on double linked lists, whose elements have values in a given set VALUE: –CreateList (VALUE) : create a new double linked list with elements taking values in Value –Append (L, Val) : append at the end a new element with given value –Insert (L, Val, Elem) : insert after Elem in L a new element with Val –Delete (L, Elem) : delete Elem from L –AccessByValue (L, Val) : return the first element in L with Val –AccessByIndex (L, i) : return the i-th element in L –empty (L), length (L), occurs (L, Elem), position (L, Elem) –Update (L, Elem, Val) : update the the value of Elem in L to Val –Cat (L1,L2) : concatenate two given lists in the given order –Split (L, Elem, L1, L2) : split L into L1, containing L up to and including Elem, and L2 containing the rest list of L

© E. Börger: Ground Model Exercises 13 Double Linked Lists : Desired Properties Prove that the Linked List ASM has the following properties: –If the next-link of a list element Elem points to Elem’, then the previous-link of Elem’ points to Elem. –L is empty iff the next-link of its head points to its tail. –The set ELEM (L) of elements occurring in a list is the set of all E which can be reached, starting from the list head, by applying next-links until the list tail is encountered. –After applying Append (L, Val), the list is not empty. –A newly created linked list is empty and its length is 0. –By Append/Delete the list length in/de-creases by 1. –For non empty L and arbitrary elements E the following holds: Append (Delete (L,E),E) = Delete (Append (L,E),E)

© E. Börger: Ground Model Exercises 14 Railroad Crossing Case Study : Problem Description C. Heitmeyer & D. Mandrioli 1996 The system to be developed operates a gate at a railroad crossing. A set of trains travel on multiple tracks in both directions. Each track has four sensors, detecting when a train enters resp. exits the crossing: L1, L2 for trains coming from the left, R1, R2 for trains coming from the right. Based on these sensor signals, a controller should signal the gate to open/close. Prove the following two properties for the system: –Safety: When a train is in the crossing, the gate is closed. –Liveness:The gate is open when no train is in the crossing.

© E. Börger: Ground Model Exercises 15 Railroad Crossing Case Study : Refinement Exercise Refine the Railroad Crossing ASM by introducing gate positions between Closed = 0 o and Opened = 90 o. Clarify the real-world timing assumptions which allow that Dir=close/open only when GateStatus=opened/closed. Hint. Consider the following timed automaton ASM, with additional GateStatus values closing, opening, and refined rules OpenGate, CloseGate. closing clock := 0 opening Dir=close clock < d close clock := 0 Dir=open clock < d open opened closed OpenGate CloseGate

© E. Börger: Ground Model Exercises 16 Stack Machine : Desired Operations Define a Stack Machine as ASM which offers the following instructions, used for executing compiled imperative code: –Op: replace the top stack prefix v by Op(v) where Op is a 0- ary or monadic or binary operation and v has length 0, 1, 2 respectively –Load(r): push the value which is in register r on top of the stack –Store(r): delete the top stack element and copy it into register r –Goto(l): transfer control to instruction with label l –Cond(l) : transfer control to instruction with label l if Cond is true for the top stack elements (as many as Cond has parameters) –Dup: duplicate the top stack element on top of the stack –Pop: delete the top element from the stack –Halt (For a solution see Jbook Fig.9.1)