University of Ottawa
SEG-2106 : Software construction
Gregor v. Bochmann

SEG-2106 - Lab-3


Play with CASE tools for UML state machines

We play with some models of "coffee machines" that accept coins and let the user choose among different drinks, such as coffee or tea.

Here are some historical notes state machine notations and tools:

The purpose of this lab is to get acquainted with UML state machine modeling

Part 1: Create a UML State Machines model of the coffee machine

Description of the Coffee Machine to be modelled in this Lab

The basic functionality of the Coffee Machine is described in the example page. Your coffee machine should include all functions shown by the LTS diagram at the beginning of the web page, plus the following features:

  1. Distinction between the controller and hardware components, and the interactions between the controller and the hardware for the preparation of tea.
  2. The machine should accept all Canadian coins and allow the repeated selection of coffee or tea if sufficient money was entered before.
  3. If after a period of 20 seconds, the user has not made any command, the machine should return all money that has not been spent.
  4. The machine should not accept any coins when no cups are available. The machine has an internal counter about the available cups. The machine has a support interface by which an employee can enter new cups and update the internal counter accordingly.
  5. Optional: The user may request the addition of sugar during the first 5 seconds after having made a request of coffee or tea.

Your task 1: Please do the following:

  1. Draw an architectural diagram - explain
  2. Identify the input and output interactions of the coffee machine (as a whole). Include any interaction parameters.
  3. Draw the state machine diagram (including state variables, enabling conditions and actions of transitions, etc.). This diagram should be drawn in the graphic notation of UML for state machines.

Part 2: Using the Umple modeling and implementation tool

Please look at the introduction to Umple is on the Web.

Your task 2-A:

Your task 2-B:

Your task 2-C: Include a "hardware" component in the coffee machine

As shown in the third architecture diagram in the Coffee Machine web page, we now assume that the control unit of the coffee machine communicates with a "hardware" conponent which helps in the preparation of tea. (For the preparation of coffee, we do not introduce any changes for this task). We assume that the output of the transitions triggered by the tea input from the user (see FSM model in the Coffee Machine web page), instead of directly producing cupOfTea, would send the output FillWater to the hardware component, which will answer with the message WaterOK, etc. as indicated by the state machine of the SDL model. After several interactions, the controller will output the cupOfTea (called cupOfWater in the SDL model) to the user, that is, to the Delivery class.

Your task 2-D: Use queued state machines

By using the keyword queued at the beginning of a Umple state machine, one obtains a state machine with input queue.

Results to be handed in: A lab report (to be submitted on paper to the TA at the next lab session)

Your lab report should report on your results for the tasks for Part 1 and Part 2 above.

The (preliminary) marking scheme is as follows:

Please consult with the TA during the Lab session. The role of the TA is to help you to do the work suggested within this Lab.

Last update: January 25, 2015