Scenario Diagram Example

broken image


A usage scenario, or scenario for short, describes a real-world example of how one or more people or organizations interact with a system. They describe the steps, events, and/or actions which occur during the interaction. Usage scenarios can be very detailed, indicating exactly how someone works with the user interface, or reasonably high-level describing the critical business actions but not the indicating how they're performed.

Usage scenarios are applied in several development processes, often in different ways. In derivatives of the Unified Process (UP) they are used the help move from use cases to sequence diagrams. The basic strategy is to identify a path though a use case, or through a portion of a use case, and then write the scenario as an instance of that path. For example, the text of the 'Withdraw Funds' use case would indicate what should happens when everything goes right, in this case the funds exist in the account and the ATM has the funds. This would be referred to as the 'happy path' or basic course of action. The use case would include alternate paths describing what happens when mistakes occur, such as there being insufficient funds in the account or the ATM being short of cash to disburse to customers. You would write usage scenarios that would explore the happy path, such as the first scenario above, as well as each of the alternate courses. You would then develop a sequence diagram exploring the implementation logic for each scenario.

Create an Entity-Relationship (ER) model is to visually represent the structure of a business database, where data equates to entities (or objects) that are linked by defined relationships expressing dependencies and requirements. By nature it is an abstract visualization, the first step in the design process towards creating a logical and functional database. ConceptDraw DIAGRAM. Generally, the level of detail for these sequence diagrams is higher than for sequence diagrams spanning use cases. Figure 3.28 shows a sequence diagram of the business use case check-in. This sequence diagram shows the scenario passenger check-in, as can be seen from the communication partners since the check-in representative does not appear.


High-Level Example

Scenario Diagram Example
Scenario: ATM banking for the week.
  1. Sally Jones places her bank card into the ATM.
  2. Sally successfully logs into the ATM using her personal identification number.
  3. Sally deposits her weekly paycheck of $350 into her savings account.
  4. Sally pays her phone bill of $75, her electric bill of $145, her cable bill of $55, and her water bill of $85 from her savings account
  5. Sally attempts to withdraw $100 from her savings account for the weekend but discovers that she has insufficient funds
  6. Sally withdraws $40 and gets her card back

Detailed Example

Scenario: A successful withdrawal attempt at an automated teller machine (ATM).
  1. John Smith presses the 'Withdraw Funds' button

  2. The ATM displays the preset withdrawal amounts ($20, $40, and so on)

  3. John chooses the option to specify the amount of the withdrawal

  4. The ATM displays an input field for the withdrawal amount

  5. John indicates that he wishes to withdraw $50 dollars

  6. The ATM displays a list of John's accounts, a checking and two savings accounts

  7. John chooses his checking account

  8. The ATM verifies that the amount may be withdrawn from his account

  9. The ATM verifies that there is at least $50 available to be disbursed from the machine

  10. The ATM debits John's account by $50

  11. The ATM disburses $50 in cash

  12. The ATM displays the 'Do you wish to print a receipt' options

  13. John indicates 'Yes'

  14. The ATM prints the receipt


As you can imagine, there are several differences between use cases and scenarios. First, a use case typically refers to generic actors, such as Customer, whereas scenarios typically refer to examples of the actors such as John Smith and Sally Jones. There's nothing stopping you from writing a generic scenario, but it's usually better to personalize the scenarios to increase their understandability. Second, usage scenarios describe a single path of logic whereas use cases typically describe several paths (the basic course plus any appropriate alternate paths). Third, in UP-based processes use cases are often retained as official documentation whereas scenarios are often discarded after they're no longer needed.

Usage scenarios are a major artifact in the Agile Microsoft Solutions Framework (MSF). They are used in combination with personas, descriptions of archetypical users such as John Smith or Sally Jones to explore the requirements for your system. With the Agile MSF you would write either style of usage scenario as appropriate, and you would keep the usage scenario only if your stakeholders are willing to make that investment in the documentation. The Agile MSF has been influenced by Agile Modeling, including the practice Discard Temporary Models.

Developing Use Case Diagrams

The primary use case consists of a standard flow of events in the system that describes a standard system behavior. The primary use case represents the normal, expected, and successful completion of the use case.

When diagramming a use case, start by asking the users to list everything the system should do for them. This can be done using interviews, in a joint application design session (as described in Chapter 4), or through other facilitated team sessions. The analyst may also use agile stories sessions (described in Chapter 6) to develop use cases. Write down who is involved with each use case, and the responsibilities or services the use case must provide to actors or other systems. In the initial phases, this may be a partial list that is expanded in the later analysis phases. Use the following guidelines:

  1. Review the business specifications and identify the actors involved.
  2. Identify the high-level events and develop the primary use cases that describe those events and how the actors initiate them. Carefully examine the roles played by the actors to identify all the possible primary use cases initiated by each actor. Use cases with little or no user interaction do not have to be shown.
  3. Review each primary use case to determine the possible variations of flow through the use case. From this analysis, establish the alternative paths. Because the flow of events is usually different in each case, look for activities that could succeed or fail. Also look for any branches in the use case logic in which different outcomes are possible.

If a context-level data flow diagram has been created, it can be a starting point for creating a use case. The external entities are potential actors. Then examine the data flow to determine if it would initiate a use case or be produced by a use case.

Figure shown below is an example of a use case diagram representing a system used to plan a conference. The actors are the Conference Chair, responsible for planning and managing the conference, the conference Participant, Speakers, a Keynote Speaker, Hotel Reservations, and a Caterer. Actors represent the role the user plays, and the Caterer may be either a hotel employee or an external catering service.

Both the Conference Chair and the Caterer are involved in planning meals and banquets. The Conference Chair is also responsible for arranging speakers. The Participant registers for the conference. Notice that the Reserve Room use case is involved in an includes relationship with the Arrange Speaker and Register for Conference use cases, since both speakers and participants will need lodging. The Arrange Language Translation use case extends the Register for Conference use case because not all participants will require language translation services. The Speaker actor is a generalization of Keynote Speaker.

Flow Diagram Examples

Flow diagram examples
Sequence diagram scenario example

Scenario Diagram Examples

Scenario Diagram Example

Use Case Diagram Example

Developing Use Case Scenarios

Example
Scenario: ATM banking for the week.
  1. Sally Jones places her bank card into the ATM.
  2. Sally successfully logs into the ATM using her personal identification number.
  3. Sally deposits her weekly paycheck of $350 into her savings account.
  4. Sally pays her phone bill of $75, her electric bill of $145, her cable bill of $55, and her water bill of $85 from her savings account
  5. Sally attempts to withdraw $100 from her savings account for the weekend but discovers that she has insufficient funds
  6. Sally withdraws $40 and gets her card back

Detailed Example

Scenario: A successful withdrawal attempt at an automated teller machine (ATM).
  1. John Smith presses the 'Withdraw Funds' button

  2. The ATM displays the preset withdrawal amounts ($20, $40, and so on)

  3. John chooses the option to specify the amount of the withdrawal

  4. The ATM displays an input field for the withdrawal amount

  5. John indicates that he wishes to withdraw $50 dollars

  6. The ATM displays a list of John's accounts, a checking and two savings accounts

  7. John chooses his checking account

  8. The ATM verifies that the amount may be withdrawn from his account

  9. The ATM verifies that there is at least $50 available to be disbursed from the machine

  10. The ATM debits John's account by $50

  11. The ATM disburses $50 in cash

  12. The ATM displays the 'Do you wish to print a receipt' options

  13. John indicates 'Yes'

  14. The ATM prints the receipt


As you can imagine, there are several differences between use cases and scenarios. First, a use case typically refers to generic actors, such as Customer, whereas scenarios typically refer to examples of the actors such as John Smith and Sally Jones. There's nothing stopping you from writing a generic scenario, but it's usually better to personalize the scenarios to increase their understandability. Second, usage scenarios describe a single path of logic whereas use cases typically describe several paths (the basic course plus any appropriate alternate paths). Third, in UP-based processes use cases are often retained as official documentation whereas scenarios are often discarded after they're no longer needed.

Usage scenarios are a major artifact in the Agile Microsoft Solutions Framework (MSF). They are used in combination with personas, descriptions of archetypical users such as John Smith or Sally Jones to explore the requirements for your system. With the Agile MSF you would write either style of usage scenario as appropriate, and you would keep the usage scenario only if your stakeholders are willing to make that investment in the documentation. The Agile MSF has been influenced by Agile Modeling, including the practice Discard Temporary Models.

Developing Use Case Diagrams

The primary use case consists of a standard flow of events in the system that describes a standard system behavior. The primary use case represents the normal, expected, and successful completion of the use case.

When diagramming a use case, start by asking the users to list everything the system should do for them. This can be done using interviews, in a joint application design session (as described in Chapter 4), or through other facilitated team sessions. The analyst may also use agile stories sessions (described in Chapter 6) to develop use cases. Write down who is involved with each use case, and the responsibilities or services the use case must provide to actors or other systems. In the initial phases, this may be a partial list that is expanded in the later analysis phases. Use the following guidelines:

  1. Review the business specifications and identify the actors involved.
  2. Identify the high-level events and develop the primary use cases that describe those events and how the actors initiate them. Carefully examine the roles played by the actors to identify all the possible primary use cases initiated by each actor. Use cases with little or no user interaction do not have to be shown.
  3. Review each primary use case to determine the possible variations of flow through the use case. From this analysis, establish the alternative paths. Because the flow of events is usually different in each case, look for activities that could succeed or fail. Also look for any branches in the use case logic in which different outcomes are possible.

If a context-level data flow diagram has been created, it can be a starting point for creating a use case. The external entities are potential actors. Then examine the data flow to determine if it would initiate a use case or be produced by a use case.

Figure shown below is an example of a use case diagram representing a system used to plan a conference. The actors are the Conference Chair, responsible for planning and managing the conference, the conference Participant, Speakers, a Keynote Speaker, Hotel Reservations, and a Caterer. Actors represent the role the user plays, and the Caterer may be either a hotel employee or an external catering service.

Both the Conference Chair and the Caterer are involved in planning meals and banquets. The Conference Chair is also responsible for arranging speakers. The Participant registers for the conference. Notice that the Reserve Room use case is involved in an includes relationship with the Arrange Speaker and Register for Conference use cases, since both speakers and participants will need lodging. The Arrange Language Translation use case extends the Register for Conference use case because not all participants will require language translation services. The Speaker actor is a generalization of Keynote Speaker.

Flow Diagram Examples

Scenario Diagram Examples

Use Case Diagram Example

Developing Use Case Scenarios

Class Diagram Scenario Example

Each use case has a description. We will refer to the description as a use case scenario. As mentioned, the primary use case represents the standard flow of events in the system, and alternative paths describe variations to the behavior. Use case scenarios may describe what happens if an item purchased is out of stock, or if a credit card company rejects a customer's requested purchase.

There is no standardized use case scenario format, so each organization is faced with specifying what standards should be included. Often the use cases are documented using a use case document template predetermined by the organization, which makes the use cases easier to read and provides standardized information for each use case in the model.

Class Diagram Example

Related:





broken image