Definition and Purpose
What Is a Use Case?
Use case: textual or diagrammatic description of system-user interaction. Purpose: capture functional requirements from user perspective. Originated in UML and requirements engineering. Focus: goal-oriented scenarios illustrating system behavior under certain conditions.
Historical Context
Introduced by Ivar Jacobson in 1986. Adopted in UML 1.0 (1997). Became a standard for capturing functional requirements and bridging communication gaps among stakeholders.
Purpose in Requirements Engineering
Clarifies system boundaries, user goals, preconditions, and expected outcomes. Facilitates validation of requirements. Supports traceability from requirements to design and testing.
"Use cases provide a bridge between users’ needs and system design, ensuring alignment and clarity." -- Ivar Jacobson
Core Components
Actors
Entities interacting with system: human users, external systems, devices. Role-based abstraction. Primary vs secondary actors distinction.
Use Case Name and Identifier
Unique descriptive label. Facilitates reference and organization. Often includes numbering scheme.
Preconditions
Conditions that must hold before execution. Defines valid system and actor state for use case initiation.
Basic Flow (Main Success Scenario)
Stepwise description of normal interaction leading to goal achievement. Core path without errors or exceptions.
Alternative Flows
Variations and exceptions. Capture error handling, branching conditions, and alternate user choices.
Postconditions
System state after successful or failed completion. Validates outcome and side effects.
Types of Use Cases
Brief Use Cases
High-level summaries. Focus on goals and actors without detailed steps. Useful for early requirements elicitation.
Casual Use Cases
Moderate detail with main success scenario plus few alternatives. Suitable for iterative refinement.
Fully Dressed Use Cases
Comprehensive descriptions including all flows, conditions, and extensions. Employed in complex systems and formal documentation.
Notation and Representation
Textual Format
Template-driven, structured prose with sections: name, actors, preconditions, flows, postconditions.
UML Use Case Diagrams
Visual abstraction showing actors, use cases, and relationships (include, extend, generalization). Focus on interaction scope.
Relationships in Diagrams
Include: mandatory sub-use case invocation. Extend: optional or conditional behavior. Generalization: inheritance among use cases or actors.
Writing Effective Use Cases
Clarity and Conciseness
Use simple, unambiguous language. Avoid technical jargon unless necessary. Focus on user goals and system responses.
Consistency
Uniform format and terminology. Maintain naming conventions for actors and use cases. Use glossary if needed.
Completeness
Cover normal and alternative flows. Specify preconditions and postconditions. Ensure all user interactions are represented.
Testability
Describe steps to allow validation via test cases. Define measurable success criteria.
Benefits and Limitations
Benefits
Improves stakeholder communication. Captures user-centered requirements. Facilitates validation and verification. Supports design and testing alignment.
Limitations
May omit non-functional requirements. Can be verbose if overly detailed. Requires skilled authorship. Not suitable for all system types (e.g., low-level technical specs).
Relationship with Other Artifacts
Use Cases and User Stories
User stories: agile, lightweight requirements. Use cases: detailed, structured scenarios. Complementary in hybrid processes.
Use Cases and Functional Requirements
Use cases describe functional requirements contextually. Functional requirements specify system capabilities in detail.
Use Cases and Test Cases
Use cases form basis for deriving test cases. Traceability links requirements to verification.
Tools Supporting Use Cases
Requirements Management Tools
Examples: IBM DOORS, Jama Connect. Features: version control, traceability, collaboration.
UML Modeling Software
Examples: Enterprise Architect, Visual Paradigm. Support use case diagrams and textual documentation.
Collaborative Platforms
Examples: Confluence, Jira. Facilitate iterative writing, review, and linking with other artifacts.
Application in Software Development
Requirements Elicitation
Use cases aid stakeholder interviews and workshops. Reveal hidden requirements and user goals.
System Design
Guide architectural decisions and component interactions. Define interfaces and responsibilities.
Testing and Validation
Derive acceptance criteria and test scenarios. Ensure system fulfills user expectations.
Best Practices
Engage Stakeholders Early
Involve users and domain experts to gather accurate use cases. Validate assumptions continuously.
Iterative Refinement
Start with brief use cases, progressively add detail. Adapt to changing requirements.
Maintain Use Case Repository
Organize and version control use cases. Facilitate reuse and consistency across projects.
Examples and Templates
Simple Use Case Example
Use Case: Login to SystemActors: UserPreconditions: User is registeredBasic Flow:1. User enters username and password2. System validates credentials3. System grants accessPostconditions: User is authenticatedAlternative Flows:2a. Invalid credentials -> System displays errorUse Case Template
| Section | Description |
|---|---|
| Use Case Name | Descriptive title |
| Actors | Entities interacting with the system |
| Preconditions | State required before initiation |
| Basic Flow | Stepwise normal scenario |
| Alternative Flows | Variations and exceptions |
| Postconditions | Resulting system state |
Common Errors and Pitfalls
Over-Detailing
Excessive steps obscure main goals. Difficult to maintain and review.
Ignoring Alternative Flows
Leads to incomplete requirements and undetected edge cases.
Mixing Functional and Non-Functional Requirements
Use cases unsuitable for performance, security, and usability specifications.
Ambiguous Language
Creates misunderstanding and implementation errors. Avoid vague verbs and pronouns.
References
- Jacobson, I., Christerson, M., Jonsson, P., & Övergaard, G. "Object-Oriented Software Engineering: A Use Case Driven Approach." Addison-Wesley, 1992.
- Cockburn, A. "Writing Effective Use Cases." Addison-Wesley, 2000.
- Rumbaugh, J., Jacobson, I., & Booch, G. "The Unified Modeling Language Reference Manual." Addison-Wesley, 2004.
- Alexander, I., & Beus-Dukic, L. "Discovering Requirements: How to Specify Products and Services." Wiley, 2009.
- Wiegers, K., & Beatty, J. "Software Requirements." Microsoft Press, 2013.