Use Case-based Requirements
This chapter gives an overall introduction to documenting requirements using use cases. In this chapter, we will explain the following: • the symbols found in a use case diagrams • the relationships between the symbols in a use case diagram • the textual description of a use case, the use case flow of events It is quite likely that you have written code in an object-oriented language, such as Java or C++. In these object-oriented languages, you have come to create your programs in terms of classes where each class has its own data (via variables/attributes) and its own behavior (via the class methods). In your programs, you create instances of these classes, called objects. As your program runs, these objects interact with each other to implement the system functionality. In this chapter we will discuss a means of documenting your stakeholder functional requirements in a way that will more easily lead you to discover what classes you will need to implement. This approach is called the use cases approach (Jacobson, Christerson et al., 1992). When you document your requirements using use cases, these use cases are then valuable during the next steps in your project development – such as in the design and testing activities. Also, it will be easier to write your user manual if you have documented your requirements by means of use cases. When we document requirements using use cases, we use textual description along with use case diagrams. The use case diagram is a part of the Unified Modeling Language (Rumbaugh, Jacobson et al., 1999), more commonly referred to as UML. In this chapter, we will first introduce you to UML. Then, we will show you how to document your requirements using use cases.
An Introduction to UML
UML is a modeling language or graphical/diagrammatic notation for object-oriented programming – a way to express the “blueprints” of your system. Within UML, there are several types of diagrams. Some of them are: • Use case diagrams for requirements • State diagrams for object-oriented analysis • Class diagrams and sequence diagrams for object-oriented design As a software engineer, you need to become well-versed in these UML diagrams. As you head towards your professional life, your peers will simply assume that you know these diagrams. When you brainstorm together, your co-workers will quickly draw one of these diagrams on a whiteboard without explaining the symbols or notations, fully expecting that you understand. Or, you might receive UML-based requirements, analysis, or design documents that you will need to work with.
Use Case-based Requirements
Once you know UML, you can also communicate with your peers using the diagrams too. You know the old adage, “A picture is worth a thousand words.” You can spend a few moments reviewing a use case, class, or sequence diagram and have a pretty good understanding of what even large programs do. UML diagrams are also very understandable to non-technical stakeholders. So, these diagrams are useful for validating requirements.
2 Scenario-based Requirements Elicitation
Before jumping into use cases themselves, we will first describe a scenario, which is a subset of a use case. A scenario is a sequence of actions that illustrates behavior. A scenario may be used to illustrate an interaction or the execution of a use case instance. (Rumbaugh, Jacobson et al., 1999) Scenarios are used in a scenario-based requirements elicitation, a technique of asking questions related to a descriptive story in order to ascertain the design requirements. For example, consider the following scenario for the Monopoly game: Player 1 lands on Blue 3. This house is owned by Player 2, and the rent is $25. Player 1 gives Player 2 $25. The above scenario specifically describes, step-by-step, what happens on one of Player 1’s turns. With scenario-based requirements elicitation, we query the stakeholders for the kinds of things they want to be able to...
Please join StudyMode to read the full document