COMP433 · Chapter 4 · building a use case diagram

From requirements to a use case diagram

What it is and where it comes from. A use case diagram is usually the first model drawn in analysis. On a single page it captures who uses the system (the actors) and what they can do with it (the use cases), so stakeholders can confirm the scope before any design starts. It is read directly out of the requirements. You do not always begin from a narrative: often the requirements phase has already produced a User Requirements (UR) list and you work from that, the narrative is simply where URs usually come from. The narrative and the URs sit beside the diagram, and as each element is drawn the text it came from lights up. Press Full screen to see both at full size.

The narrative

A boutique hotel wants a small online booking system. A guest searches for rooms by date and the system shows what is available. The guest picks and books a room, entering details and card, and the system takes payment through an external payment provider; if the card is declined the guest can try again. A guest may also enter a promo code for a discount. Guests can cancel a booking, and the manager keeps the room list up to date.

User requirements (read from it)

  • UR1 A Guest can search for available rooms by date.
  • UR2 A Guest can book an available room and pay for it through the payment provider.
  • UR3 A Guest can cancel an existing booking.
  • UR4 A Hotel Manager can maintain the room list and rates.
  • UR5 A Guest may apply a promo code for a discount when booking.
Hotel Booking SystemGuestSearch roomsBook roomCancel bookingHotel ManagerManage roominventoryCheck availability<<include>><<include>>Process payment<<include>>Apply promo code<<extend>>[has promo]Payment Provider