Difference between revisions of "Use Cases"

From EUDP
Jump to: navigation, search
 
(Example)
 
(22 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
== What ==
 
== What ==
  
Use Case Analysis - an assessment and a selection of the use case candidates and actor candidates, a description of the selected candidates and finally drawing a use case diagram with use cases and actors.
+
Use Case Analysis: An assessment and a selection of the [[Use Case Candidates]] and [[Actor Candidates]], a description of the selected candidates and finally, the drawing of a use case diagram with use cases and actors.
 
+
   
+
  
 
== How ==
 
== How ==
Line 14: Line 12:
 
'''Ingredients '''  
 
'''Ingredients '''  
  
*    Preliminary Use Cases  
+
*    [[Preliminary Use Cases]]
*    Use Case Candidates
+
*    [[Use Case Candidates]]
*    Actor Candidates  
+
*    [[Actor Candidates]]
  
 
'''Process'''
 
'''Process'''
  
Draw a Use Case Diagram
+
'''Draw a use case diagram'''
As a help to understand the user interaction with the system, the developer can use the use case diagram. Sometimes it helps to do this before the actual writing of the use cases, but it may also be a help to assess the use cases after they have been written.
+
  
You prepare the use case diagram by drawing the use cases as bubbles with names in a single column. At the left or the right side of the use cases you draw the different actors of the system. Draw lines from the actor to the use cases he/she/it participates in.  
+
As a help to understand the user interaction with the system, the developer can choose a use case diagram. Sometimes it helps to do this before the actual writing of the use cases, but it may also be a help to assess the use cases after they have been written.
Assessment and Selection of Use Case Candidates
+
  
From the list of use case candidates and maybe the use case diagram you now choose which ones are most important and subsequently write them.
+
You prepare the use case diagram by drawing the use cases as bubbles with names in a single column. At the left or the right side of the use cases, you draw the different actors of the system. Draw lines from the actor to the use cases in which he/she/it participates.
 +
   
 +
'''Assess and select Use Case Candidates'''
  
Unimportant use cases are usually the ones the developer knows exactly how to implement. A developer who develops e.g. web applications will not write a use case for the login process, because this is a standard procedure on websites, but perhaps the developer will write a use case which describes how a user would update the contents of the site.
+
From the list of use case candidates and maybe also the use case diagram, you now choose which ones are most important and subsequently write them.
  
When you have chosen the most important use cases, see if some of them contain more or less the same interaction with the system. Maybe these use cases should only be written as one use case? If two or more use cases have almost the same type of interaction with the system like entering data information into a form, it might be sufficient to write only one of them.
+
Unimportant use cases are usually the ones the developer knows exactly how to implement. A developer who develops e.g. web applications will not write a use case for the login process, because this is a standard procedure on websites, but perhaps the developer will write a use case describing how a user would update the contents of the site.
How to write Use Cases
+
  
The developer has chosen which use cases are most important, and it is now time to write out the use case candidates. Write them as text (5 - 50 lines). Write from a user's (human or system) point of view how he/she/it would interact with the system-to-be.
+
When you have chosen the most important use cases, see if some of them contain more or less the same interaction with the system. Maybe these use cases should only be written as one use case? If two or more use cases have almost the same type of interaction with the system, e.g. entering data information into a form, it might be sufficient to write only one of them.
  
The purpose of writing is to get as much possible knowledge about the system, so that you can estimate the development price of the system-to-be. Normally, this means that the developer only writes the most important success scenarios, and maybe a single fail scenario.
+
'''How to write use cases'''
 +
 
 +
The developer has chosen which use cases are the most important, and it is now time to write out the use case candidates. Write them as text (5-50 lines) and write from a user's (human or system's) point of view how he/she/it would interact with the system-to-be.
 +
 
 +
The purpose of writing is to get as much knowledge about the system as possible, so that you can estimate the development price of the system-to-be. Normally, this means that the developer only writes the most important success scenarios, and maybe a single fail scenario.
  
 
Do not write how to implement the functions, but write them as a use case, i.e. how to use the system.
 
Do not write how to implement the functions, but write them as a use case, i.e. how to use the system.
  
Only write the use cases which help you understand the system better, and save the other ones until later in the development process.  
+
Only write the use cases which help you understand the system better, and save the other ones until later on in the development process.
  
 
== Why ==
 
== Why ==
Line 47: Line 48:
 
Why is a use case important?
 
Why is a use case important?
  
A use case is important for the developer if he/she wonders how this interaction with the system will accomplish. Therefore, the main purpose of writing a use case is to get a grip of the interaction with the system. Focusing on the difficult interactions often facilitate the solution!
+
A use case is important for the developer if s/he wonders how the interaction with the system is accomplished. Therefore, the main purpose of writing a use case is to understand the interaction with the system. Focusing on the difficult interactions often leads to the solution!
  
The use case analysis helps gather all the different user aspects of the project. The developer assesses the importance of the different use cases and thereby he/she realises where some of the difficulties in the project are. By writing the success scenario, the developer transforms all the thoughts that he/she has in his/her mind to the paper. This way it is possible to focus on other aspects in the project, and maybe see new angles.   
+
The use case analysis helps gather the different user aspects of the project. The developer assesses the importance of the use cases and thereby, s/he realises where the difficulties in the project lie. By writing the success scenario, the developer transforms all the thoughts that s/he has in her/his mind to the paper. In this way, it is possible to focus on other aspects in the project and perhaps find new angles.   
  
The use case diagram helps to get an overview of the actor interaction with the different use cases. It is a quick task to draw such a diagram, but it shows the most important actors which can be used later on in e.g. the user interface description.
+
The use case diagram helps to get an overview of the actor interaction with the various use cases. It is a quick task to draw such a diagram, but it shows the most important actors which can be used later on, e.g. in the user interface description.
  
 
== Example ==
 
== Example ==
  
Configure week plan
 
  
''Description:''
+
Example of a use case from the diagram:
 
+
The use case enables the user to set, on a daily basis, the time span in which the day temperature will be maintained. For each day, the user enters the time of day the temperature shall raise to normal level and the time at which the temperature will be lowered to night temperature. It is possible for the user to set only one temperature and let the setting repeat for the whole week.
+
 
+
''Actors:''
+
 
+
House occupier
+
 
+
''Prerequisites:''
+
 
+
Actor logged into the system.
+
 
+
Detailed Use Case:
+
 
+
+
 
+
Actor                            System
+
 
+
1 Selects the week plan
+
configuration from the menu
+
+
  
 +
'''Name'''
 +
Turn on the vehicle
 +
 +
'''Brief description'''
 +
Turn on all electronics and prepare the vehicle for driving
 +
 +
'''Actors'''
 +
Engineer
 +
Driver
 +
 +
'''Preconditions'''
 +
The energy source is present in the vehicle.
 +
The vehicle is turned off.
 +
 +
'''Basic flow of events'''
 +
1. Actor turns the main switch
 +
2. Power is distributed to systems following the specified scheme
 +
3. The use case ends successfully
 +
 +
'''Alternative flows'''
 
   
 
   
 +
'''''No energy source present'''''
 +
1. Led energy source is set to blink
 +
 +
'''''Error on an attached component'''''
 +
1. The power-on sequence is reversed to power-off the modules in the correct order
 +
2. The error led is set to blink
 +
 +
'''Postconditions'''
 +
'''''Successful completion'''''
 +
1. The vehicle is powered and ready for driving
 +
2. Logs have been updated with events during the power-up sequence
 +
 +
'''''Failure completion'''''
 +
1. There is no power on the vehicle modules
 +
2. Logs have been updated with events during the power-up and power-down sequence
 +
3. Leds are blinking
  
2 Displays the week plan configuration
+
Often it can be easier to overlook a table. The same Use Case as above is here set in a table.
  
3  Enters start time for Monday and end time.
+
[[Image:Use_Case_analysis.png|600 px]]
  
Selects that the setting should repeat through the whole week.
+
[[Image:UseCases.png|600 px]]
 
+
Clicks on the Save button
+
+
 
+
+
  
4      Stores the information repeating the setting for all days in the week in the database.
+
== Used In ==
  
5        Displays the menu.
+
The Use Cases are used in the rest of the design phase as well as in the [[Realisation Phase]]. From here, you may want to go to the [[Interface Analysis]]

Latest revision as of 08:51, 3 October 2016

What

Use Case Analysis: An assessment and a selection of the Use Case Candidates and Actor Candidates, a description of the selected candidates and finally, the drawing of a use case diagram with use cases and actors.

How

The dish

Use Case Analysis

Ingredients

Process

Draw a use case diagram

As a help to understand the user interaction with the system, the developer can choose a use case diagram. Sometimes it helps to do this before the actual writing of the use cases, but it may also be a help to assess the use cases after they have been written.

You prepare the use case diagram by drawing the use cases as bubbles with names in a single column. At the left or the right side of the use cases, you draw the different actors of the system. Draw lines from the actor to the use cases in which he/she/it participates.

Assess and select Use Case Candidates

From the list of use case candidates and maybe also the use case diagram, you now choose which ones are most important and subsequently write them.

Unimportant use cases are usually the ones the developer knows exactly how to implement. A developer who develops e.g. web applications will not write a use case for the login process, because this is a standard procedure on websites, but perhaps the developer will write a use case describing how a user would update the contents of the site.

When you have chosen the most important use cases, see if some of them contain more or less the same interaction with the system. Maybe these use cases should only be written as one use case? If two or more use cases have almost the same type of interaction with the system, e.g. entering data information into a form, it might be sufficient to write only one of them.

How to write use cases

The developer has chosen which use cases are the most important, and it is now time to write out the use case candidates. Write them as text (5-50 lines) and write from a user's (human or system's) point of view how he/she/it would interact with the system-to-be.

The purpose of writing is to get as much knowledge about the system as possible, so that you can estimate the development price of the system-to-be. Normally, this means that the developer only writes the most important success scenarios, and maybe a single fail scenario.

Do not write how to implement the functions, but write them as a use case, i.e. how to use the system.

Only write the use cases which help you understand the system better, and save the other ones until later on in the development process.

Why

The main goal of this project phase is for the developer to get an idea of the range of the project, so it is possible to estimate the economics of the project.

Why is a use case important?

A use case is important for the developer if s/he wonders how the interaction with the system is accomplished. Therefore, the main purpose of writing a use case is to understand the interaction with the system. Focusing on the difficult interactions often leads to the solution!

The use case analysis helps gather the different user aspects of the project. The developer assesses the importance of the use cases and thereby, s/he realises where the difficulties in the project lie. By writing the success scenario, the developer transforms all the thoughts that s/he has in her/his mind to the paper. In this way, it is possible to focus on other aspects in the project and perhaps find new angles.

The use case diagram helps to get an overview of the actor interaction with the various use cases. It is a quick task to draw such a diagram, but it shows the most important actors which can be used later on, e.g. in the user interface description.

Example

Example of a use case from the diagram:

Name
Turn on the vehicle

Brief description
Turn on all electronics and prepare the vehicle for driving

Actors
Engineer
Driver

Preconditions
The energy source is present in the vehicle.
The vehicle is turned off.

Basic flow of events
1. Actor turns the main switch
2. Power is distributed to systems following the specified scheme
3. The use case ends successfully

Alternative flows

No energy source present
1. Led energy source is set to blink

Error on an attached component
1. The power-on sequence is reversed to power-off the modules in the correct order
2. The error led is set to blink

Postconditions
Successful completion
1. The vehicle is powered and ready for driving
2. Logs have been updated with events during the power-up sequence

Failure completion
1. There is no power on the vehicle modules
2. Logs have been updated with events during the power-up and power-down sequence
3. Leds are blinking

Often it can be easier to overlook a table. The same Use Case as above is here set in a table.

Use Case analysis.png

UseCases.png

Used In

The Use Cases are used in the rest of the design phase as well as in the Realisation Phase. From here, you may want to go to the Interface Analysis