Knowledge Systems Corporation

About KSC

Press and Media

Job Opportunities

KSC Articles

Contact KSC

Site Map

Home


Courses
Smalltalk Courses
Java Courses
OO Courses
 
Opportunities
Jobs with Smalltalk
Jobs with Java
Jobs with .NET
Jobs with Data Base
Employers Sign Up Here
 
Business Services
Migration Services
System Implementation
Application Development
 
Education Services
Tutoring
Immersion Programs
 


 

Use Cases: the Pros and Cons

By Donald G. Firesmith

Introduction

Over the last three years, use cases have become well established as one of the fundamental techniques of object-oriented analysis. Although initially introduced by Ivar Jacobson to the object community at the 1987 OOPSLA conference [1], it was the publication of his book Object-Oriented Software Engineering: A Use Case Driven Approach [2] in 1992 that marked the true beginning of use cases´ meteoric rise in popularity. Possibly in reaction to the previous structured methods, early object-oriented development methods overemphasized static architecture and partially ignored dynamic behavior issues during requirements analysis, especially above the individual class level where state modeling provides an important technique for dynamic behavior specification. Use cases provide a great many benefits in addition to correcting this overemphasis, and most major object-oriented development methods (including my own) have jumped on the band wagon and added use cases during the last few years. In the resulting hoopla and hype, however, there has been little discussion of the limitations and potential pitfalls associated with use cases. This column is an attempt to provide a more balanced presentation and to caution against the uncritical acceptance of use cases as the latest patent medicine for all software ailments.

 

Mission Software

Has created a Smalltalk compiler for the Java Virtual Machine. This compiler allows Smalltalk to run on any JVM. The compiler currently produces 100% Java class files fully compatible with the Sun Java Virtual Machine specification. This allows Smalltalk and Java code to interact seamlessly and allows Smalltalk programs to run anywhere Java runs! Click to learn more

 

Definitions

The term use case was introduced by Ivar Jacobson et al. [1] and has been defined in several publications [234]. A use case is a description of a cohesive set of possible dialogs (i.e., series of interactions--see Note 1) that an individual actor initiates with a system. An actor is a role played by a user (i.e., an external entity that interacts directly with the system). See Figure 1. A use case is thus a general way of using some part of the functionality of a system.
 


 

Figure 1: The Primary Use Case Notations
 

A use case is not a single scenario but rather a 'class' that specifies a set of related usage scenarios, each of which captures a specific course of interactions that take place between one or more actors and the system. Therefore, the description of an individual use case typically can be divided into a basic course and zero or more alternative courses. The basic course of a use case is the most common or important sequence of transactions that satisfy the use case. The basic course is therefore always developed first. The alternative courses are variants of the basic course and are often used to identify error handling. Within reason, the more alternative courses identified and described, the more complete the description of the use case and the more robust the resulting system.

As a user-centered analysis technique, the purpose of a use case is to yield a result of measurable value to an actor in response to the initial request of that actor. A use case may involve multiple actors, but only a single actor initiates the use case. Because actors are beyond the scope of the system, use-case modeling ignores direct interactions between actors.

A use case may either be an abstract use case or a concrete use case. An abstract use case will not be instantiated on their own, but is only meaningful when used to describe functionality that is common between other use cases. On the other hand, a concrete use case can be instantiated to create a specific scenario.

According to Ivar Jacobson, use cases are related by two main associations: extends and uses. The extends association specifies how one use case description inserts itself into, and thus extends, a second use case description that is completely independent and unknowing of the first use case. Depending on some condition, the second use case may either be performed with or without the extending use case. Extends can therefore be viewed as a kind of 'inheritance' between use cases in which the original use case definition is extended by the extending use case definition to form a new 'combined' use case. On the other hand, the uses association can be viewed as a kind of 'delegation' or 'aggregation' that captures how one or more use case descriptions incorporate the common description of another use case. These two associations are closely related and easy to confuse. One clue as to which is which is that if A extends B, then the extended B 'contains' A, whereas if A uses B, then A 'calls' B. The actual distinction between these two associations is unclear, and Rumbaugh [4] has thankfully combined them into a single adds association from the main concrete use case to the abstract use cases that it uses.

Clearly, use cases are functional abstractions and are thus large operations, the implementation of which thread through multiple objects and classes. However, a use case need not have anything to do with objects. As pointed out by Jacobson [5], " … it should be clear that use-case modeling is a technique that is quite independent of object modeling. Use-case modeling can be applied to any methodologyóstructured or object-oriented. It is a discipline of its own, orthogonal to object modeling."
 

An Example

The requirements for Door Master, a security system for controlling entry of employees through a secured door, are documented in a previous ROAD column [6]. Except for those requirements concerned with initialization, the functional requirements for Door Master are captured in the following nine use cases:

  1. Enter the Disabled Door. Employees and security guards enter freely through the door when Door Master is disabled.
  2. Enter the Secured Door. Employees and security guards enter through the door by (1) entering the entry code on the numeric keypad, (2) entering through the door, and (3) closing the door behind them.
  3. Change the Entry Code. Security guards change the entry code by (1) pressing the change entry code button on the control panel, (2) providing authorization by entering the security code on the numeric keypad, (3) entering the new entry code on the numeric keypad, and (4) verifying the new entry code by reentering it on the numeric keypad.
  4. Change the Security Code. Security guards change the security code by (1) pressing the change security code button on the control panel, (2) providing authorization by entering the old security code on the numeric keypad, (3) entering the new security code on the numeric keypad, and (4) verifying the new security code by reentering it on the numeric keypad.
  5. Enable the Door Master. Security guards enable Door Master by (1) pressing the enable button on the control panel and (2) providing authorization by entering the security code on the numeric keypad. Door master then (3) turns off the disabled light, (4) turns on the enabled light, and (5) locks the door.
  6. Disable the Door Master. Security guards disable Door Master by (1) pressing the disable button on the control panel and (2) providing authorization by entering the security code on the numeric keypad. Door master then (3) turns off the enabled light, (4) turns on the disabled light, and (5) unlocks the door.

    The following two abstract use cases are common to, and are therefore used by, five of the concrete use cases:

  7. Enter the Entry Code. Employees and security guards enter the entry code by pressing five keys on the numeric keypad followed by the enter key. Door master beeps after each key and verifies the entry code.
  8. Enter the Security Code. Employees and security guards enter the entry code by pressing seven keys on the numeric keypad followed by the enter key. Door master beeps after each key and verifies the entry code.

    The following abstract use case extends the Enable the Door Master and Enter the Secured Door use cases:

  9. Raise the Alarm. The alarm is raised if the door is left open too long or if the door is not shut when Door Master is enabled. The security guards disable the alarm by entering the security code.


 


 

Figure 2: An example Use Case Model
 

The Benefits of Use Cases

Use cases have become extremely popular since the publication of Object-Oriented Software Engineering: A Use Case Driven Approach in 1992. They have been added to numerous object-oriented development methods (e.g., Booch, Firesmith, Rumbaugh) because they offer many important advantages, including the following:


 

The Dangers of Misusing Use Cases

Because of their many important advantages and extreme popularity, use cases have become a fundamental part of object technology and have been incorporated in one form or another into most major object-oriented development methods. In the rush to jump onto the use case bandwagon, use cases have been perceived by some as either a panacea or as an end in-and-of themselves. Unfortunately, this has often led to the uncritical acceptance of use cases without any examination of their numerous limitations and ample opportunities they offer for misuse. The following provides an overview of the major risks associated with use cases:


 

CONCLUSION

What then should developers do? Use cases clearly offer many important benefits and are powerful weapons that probably should be in the arsenal of all software analysts, designers, and testers. Unfortunately however, they are functional rather than object-oriented and can significantly compromise the benefits of object technology if blindly added at to the object-oriented development process. Fortunately, the risks associated with use case modeling can be mitigated through knowledge, training, and avoiding an over enthusiastic acceptance. Use cases should be only one of several ways of capturing user requirements. The model of objects, classes, and their semantic relationships should be consistent with, but not totally driven by, the use cases. Designers should beware of and minimize scattering the features of a use case's objects and classes, and they should exercise great care to avoid the creation of partial, redundant variants of classes, especially on large projects involving multiple builds and releases. The architectural guidelines of Rebecca Wirfs-Brock [9] should be followed to avoid creating excessive functional controller objects that dictate the behavior of dumb entity objects. Most importantly, use cases should not be used as an excuse to revert back to the bad old days of functional decomposition and functionally decomposed requirements specifications.
 

Notes

Note 1--A use case typically involves branching or looping and may depend on the state of the system and any parameters of the interactions between actors and the system.

Note 2--Because a use case (class) is not as specific as a usage scenario (instance), use cases may lack sufficient formality and detail to supply adequate criteria for the passing of acceptance tests.

 

BIBLIOGRAPHY

[1] Ivar Jacobson, Object-Oriented Development in an Industrial Environment, Proceedings of OOPSLA´87, SIGPLAN Notices, Vol. 22, No. 12, pages 183-191, 1987.

[2] Ivar Jacobson, Magnus Christerson, Patrik Jonsson, and Gunnar Övergaard, Object-Oriented Software Engineering: A Use Case Driven Approach, Addison-Wesley, Wokingham, England, 1992.

[3] Ivar Jacobson, Maria Ericsson, and Agneta Jacobson, The Object Advantage: Business Process Re-engineering with Object Technology, Addison-Wesley, Wokingham, England, 1995.

[4] James Rumbaugh, "Getting Started: Using Use Cases to Capture Requirements," Journal of Object-Oriented Programming (JOOP), SIGS Publications, Vol. 7, No. 5, New York, New York, September 1994, pages 8-12.

[5] Ivar Jacobson, "Basic Use-Case Modeling (Continued)," Report on Object-Oriented Analysis and Design (ROAD), SIGS Publications, Vol. 1, No. 3, New York, New York, September/October 1994, page 7.

[6] Donald G. Firesmith, "Modeling the Dynamic Behavior of Systems, Mechanisms, and Classes with Scenarios," Report on Object-Oriented Analysis and Design (ROAD), SIGS Publications, Vol. 1, No. 2, New York, New York, July/August 1994, pages 32-36.

[7] Grady Booch, Object-Oriented Analysis and Design with Applications, The Benjamin/Cummings Publishing Company, Redwood City, California, 1994, page 515.

[8] Derek Coleman, Patrick Arnold, Stephanie Bodoff, Chris Dollin, Helena Gilchrist, Fiona Hayes, and Paul Jeremaes, Object-Oriented Development: The Fusion Method, Prentice Hall, Englewood Cliffs, NJ, 1994.

[9] Rebecca Wirfs-Brock, Brian Wilkerson, and Lauren Wiener, Designing Object-Oriented Software, Prentice Hall, Englewood Cliffs, NJ, 1990.
 

 


Mission Software

DotNetBuzz

 

Knowledge Systems Corporation is a member of the Smalltalk Webring.

 This Smalltalk Webring site is owned by Knowledge Systems Corporation.
[ Previous Page | Next Page | Skip Next | List Next 5 | Random Link ]
Want to join the ring? Click here for info

Email:  Sales sales@ksc.com
Copyright © 2002 - Knowledge Systems Corporation