use cases use cases are employed to describe the functionality or behavior of a system. each use...

23
Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system provides it's clients.

Upload: leon-bradford

Post on 13-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Cases

• Use Cases are employed to describe the functionality or behavior of a system.• Each use case describes a different capability

that the system provides it's clients.

Page 2: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Cases

• A use case contains:• An actor or actors that represent the role the

user plays while interacting with the system.

• A scenario that describes a sequence of steps detailing an interaction between the actor and the system.

• It describes one feature that is provided by the system.

Page 3: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Cases

• A use case is a set of scenarios that have a common user goal (function).

Page 4: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Actors

• The actor in a use case represents the users of a system.• The users can be humans, and/or other systems.

• The system actors may play multiple roles in a system.

• For instance, a Sales manager maybe both a supervisor and a salesman.

• A single actor may carry out many use cases.

Page 5: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Identifying Actors

• Some questions to help identify the system actors are:

• Who is interested in a particular requirement?

• Where in the organization is the system used?

• Who will benefit from the system use?

• Who will supply the system with this information, use this information, and remove this information?

• Who will support and maintain the system?

• Does the system use an external resource?

Page 6: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Identifying Actors

• Does one person play several different roles?• Do several people play the same role?• Does the system interact with a legacy system?

Page 7: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Cases

• Not all use cases will be obvious.

• Some methods for identifying use cases are:• Reviewing focus group session results.

• Observing how users interact and use similar systems or their current system.

• Reviewing the marketing requirements document.

• Interacting with the customer.

Page 8: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Cases

• Some questions to ask that can help identify use cases are:• What are the tasks of each actor?• Will any actor create, store, change, remove, or

read information in the system?• What use cases will create, store, change,

remove, or read this information?• Will any actor need to inform the system about

sudden, external changes?• Does any actor need to be informed about

certain occurrences in the system?

Page 9: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Cases

• What use cases will support and maintain the system?

• Can all functional requirements be performed by the use cases?

Page 10: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Development Dangers

• It is very easy to attempt to define all the use cases and their alternatives in a system. • Eventually you will reach the point of diminishing

returns.• Strive for the 80/20 rule.

• A good rule of thumb is:• A use case typically represents a major piece of

functionality that is complete from beginning to end. A use case must deliver something of value to an actor.

Page 11: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Flow

• A use case essentially documents the flow of events that are needed to accomplish the required behavior.

• The flow of events should include:

• When and how the use case starts and ends.

• What interaction the use case has with the actors.

• What data is needed by the use case.

• The normal sequence of events for the use case.

• The description of any alternate or exceptional flow.

Page 12: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Outline

X. Use Case Name

X.1 Precondition

X.2 Main Flow

X.3 Subflows (if applicable)

X.4 Alternative flows

Page 13: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Simple Use Case

• Jim needs to check his email to see if he has mail from his mother. He opens his mail program on the computer and browses through the messages. He finds a message from his mother.

Page 14: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Simple Use Case

1. Check mail

1.1 The preconditions assume that the computer is up an running.

1.2 Main Flow

a. Open mail program.

b. Browse through the new mail messages.

c. Find an email from mother.

Page 15: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Simple Use Case

1.4 Alternative: Mail program not active.

At step 1, the mail program is not open.

a. Allow the user to start the mail program.

a.1 The user starts the mail program.

a.2. The user enters the appropriate password.

Page 16: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Student Course Use Case

• We are developing a system that will allow students to review the courses that they have registered for. When the students log onto the system they need to provide their student id number, a password, and the quarter they wish to review. Once this information is properly entered, the student is presented with a listing of courses for the quarter.

Page 17: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Professor's Course Use Case

• Another user of our system is the professor. • When entering the system the professor needs

to provide a user name and password.

• The professor needs to indicate to the system what courses he will teach during a particular quarter.

• The professor also needs to be able to get a list of the students registered for his courses (course roster).

Page 18: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Relationships

• A relationship indicates the communication between an actor and a use case.• The relationship is called an association

relationship.

• The actor may communicate to the use case (system).

• The use case (system) may communicate to the actor.

• Communication may flow in both directions.

Page 19: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Relationships

• It is possible that a system may contain multiple use cases that contain the same behavior. In this case, the identical behavior is defined as it's own use case and the multiple use cases refer to the similar behavior use case.

• This is called an include relationship.

• The association is labeled with <<include>>.

• Defining a separate use case for the common behavior implies that one does not have to copy the description of that behavior to every use case that uses it.

Page 20: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Relationships

• If use case A is defined and a use case B does just a bit more then the use case A, then use case A can be generalized to capture the alternative scenario represented in use case B.• This is called a use case generalization

association.

• The generalization use case is associated with another use case.

• Most likely the generalized use case is not associated with an actor.

Page 21: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Relationships

• Another relationship involves extending a use case to add behavior to the base use case but specific “extension points” are declared. • This is called an extend relationship.

• The association is labeled with <<extend>>.

• When the extend relationship is used, the additional behavior may only be added at the extension points.

• An extension use case may also include “extension points” itself.

Page 22: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Relationships• When to use include, generalization, and extend:

• If the same steps are repeated in two or more separate use cases then use the include relationship to avoid the repetition.

• If there is a variation on the normal behavior then use the generalization relationship.

• If there is a variation on the normal behavior but there is a need to use a more controlled form, then use the extend relationship.

• Remember to declare the extension points in the base use case.

Page 23: Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system

Use Case Diagrams

• The use case diagram shows:• The actors.

• The use cases.

• The relationships between the actors and use cases as well as use cases and use cases (extends, generalization, extends).