Use Cases and Usage Scenarios
Use Cases and Usage Scenarios
Use Cases and Usage Scenarios
It has been mentioned earlier on; excellent software products are the result of a well-
executed design based on excellent requirements and high quality requirements result
from effective communication and coordination between developers and customers. That
is, good customer-developer relationship and effective communication between these two
entities is a must for a successful software project. In order to build this relationship and
capture the requirements properly, it is essential for the requirement engineer to learn
about the business that is to be automated.
One tool used to organize and structure the requirements is such a fashion is called use
case modeling.
A use case model has two components, use cases and actors.
In a use case model, boundaries of the system are defined by functionality that is handled
by the system. Each use case specifies a complete functionality from its initiation by an
actor until it has performed the requested functionality. An actor is an entity that has an
interest in interacting with the system. An actor can be a human or some other device or
system.
A use case model represents a use case view of the system – how the system is going to
be used. In this case system is treated as a black box and it only depicts the external
interface of the system. From an end-user’s perspective it and describes the functional
requirements of the system. To a developer, it gives a clear and consistent description of
what the system should do. This model is used and elaborated throughout the
development process. As an aid to the tester, it provides a basis for performing system
tests to verify the system. It also provides the ability to trace functional requirements into
actual classes and operations in the system and hence helps in identifying any gaps.
As an example, consider the following use case diagram for a library management
system. In this diagram, there are four actors namely Book Borrower, Librarian, Browser,
and Journal Borrower. In addition to these actors, there are 8 use cases. These use cases
are represented by ovals and are enclosed within the system boundary, which is
represented by a rectangle. It is important to note that every use case must always deliver
some value to the actor.
With the help of this diagram, it can be clearly seen that a Book Borrower can reserve a
book, borrow a book, return a book, or extend loan of a book. Similarly, functions
performed by other users can also be examined easily.
Creating a Use Case Model
Creating a use case model is an iterative activity. The iteration starts with the
identification of actors. In the next step, use cases for each actor are determined which
define the system. After that, relationships among use cases are defined. It must be
understood that these are not strictly sequential steps and it is not necessary that all actors
must be identified before defining their use cases. These activities are sort of parallel and
concurrent and a use case model will evolve slowly from these activities. This activity
stops when no new use cases or actors are discovered. At the end, the model is validated.
This diagram also demonstrates that many different actors can use one use case.
Additionally, the actors defined for the base use case are also defined by default for the
derived use case.
The concept of reusability can also be used in the case of actors. In this case, new classes
of actors may be created by inheriting from the old classes of actors.
Credit Card
Validation System
Perform Card
Transaction
Reconcile
Transactions
Individual Corporate
Manage
Customer Customer Sponsoring
Customer Acct
Financial
Institution
Extended User
In this case two new classes, Individual Customer and Corporate Customer, are being
created by extending Customer. In this case, all the use cases available to Customer
would also be available to these two new actors.
Elaborated Use Cases
After the derivation of the use case model, each use is elaborated by adding detail of
interaction between the user and the software system. An elaborated use case has the
following components:
s >> Record
u se Transaction
<<
Delete
Information
<<
us e
User s>
> Cancel
Transaction
Priority: 3
Actors: User
Summary: Deleting information allows the user to permanently remove information from
the system. Deleting information is only possible when the information has not been used
in the system.
Preconditions: Information was previously saved to the system and a user needs to
permanently delete the information.
Extends: None
Exceptions:
1. The system will not allow a user to delete information that is being used in the
system.
2. The system will not allow a user to delete another user that has subordinates.
Assumptions:
1. Deleting information covers a permanent deletion of an entire set of data such as a
commission plan, user, group etc. Deleting a portion of an entire set constitutes
modifying the set of data.
2. Deleted information is not retained in the system.
3. A user can only delete information that has not been used in the system.
Alternative Ways of Documenting the Use Case
Many people and organizations prefer to document the steps of interaction between the
use and the system in two separate columns as shown below.
Use Case Title Write Title Here (must match use case title in use
case diagram)
Abbreviated Title
Use Case Id
Requirement Id
Description:
Pre Conditions:
Task Sequence Exceptions
1.
2.
3.
.
.
Post Conditions:
Unresolved issues:
Authority:
Modification history:
Author:
Description:
Limitations of Use Cases
Use cases alone are not sufficient. There are kinds of requirements (mostly non-
functional) that need to be understood. Since use cases provide a user’s perspective, they
describe the system as a black box and hide the internal details from the users. Hence, in
a use case, domain (business) rules as well as legal issues are not documented.
The non-functional requirements are also not documented in the use cases. As examples
of those, consider the following requirements.
• Usability
o Color blind people should not have any difficulty in using the system – color
coding should take care of common forms of color blindness.
• Reliability
o The system needs to support 7 x 24 operation
• Performance
o Authorization should be completed within 1 minute 90% of the time.
o Average authorization confirmation time should not exceed 30 seconds.
• Portability
o The system should run on Windows 98 and above as well as Sun Solaris 7.0
and above.
• Access
o System should be accessible over the internet – hidden requirement – security