What are use cases in software development?

A use case explains how the user will perform tasks on the software. The specification of use cases is typically documented in a requirements document before the development. Use cases are characterized as follows:

Business use cases describe the high-level functional requirement. It is written in non-technical terms so that the end-users and customers can easily understand them.

For example, in a hotel management system, the business use case is defined as follows: The user looks at different room packages and books a room.

System use cases describe the functional requirement in lower-level implementation details and might include technical jargon.

For example, in a hotel management system, the system use case is defined as follows:

The user browses the room packages and books a room through a web application.

Use case model

The use cases of a system are commonly represented through a use case model. A use case model consists of the following components:

  • Actors - the users who interact with the system.

  • Use Cases - a written description of the requirements from the actor’s point of view.

  • Relationships between actors and use cases.

The use case model can be used to represent use cases in a use case diagram. A simple example of the use case diagram of an e-commerce website is shown below:

  • The two actors are customer and admin.

  • The three use cases are browse information, place order, and view orders.

  • Both the customer and admin can browse information. However, only the customer can place order. Likewise, only the admin can view orders.

Writing a use case

To write a use case, follow the steps given below:

  1. Identify the system’s actors and start with one of the actors, for example, the customer of an e-commerce website.

  2. Define what the customer wants to use the system for. For example, browsing information or online shopping. All these actions will become the use cases.

  3. For each use case, describe the normal and alternate flow of events. The flow of events should include the customer’s actions and the system’s responses to them.

Repeat the steps for all the actors of the system.

Use Case Example

Use Case ID

1

Use Case Name

View Orders

Actors

Admin

Description

The admin will be able to view all the orders placed by the customer.

Normal Flow

  1. The admin will log in.
  2. The admin will select the 'View Orders' option.
  3. The admin will be prompted to select any filters (date or time).
  4. The admin will select the filters.
  5. The system will display the relevant orders on the screen.

Alternate Flow

None

Advantages of use cases

Use cases help organize the various functions of the system from the perspective of different users. They help the development team to brainstorm ideas and access the feasibility of the use cases. Hence, defining use cases is an essential step in software development.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved