Why Bother with Use Cases? WHAT ARE "USE CASES" ALL ABOUT? In a world where it seems we already have too much to do, and too manythings to think about, it seems the last thing we need is something new thatwe have to learn. As Eric Sevareid observed, the chief cause of problems issolutions. But use cases do solve a problem with requirements: with strict declarativerequirements it's hard to describe steps and sequences of events. To seewhy, let's consider a simple example: Example Some requirements that must be satisfied by an automated teller system: The system shall allow customers to withdraw cash from their accounts. The system shall ensure that the customer's account is never overdrawn. If the customer attempts to overdraw the account, the system will allow the account to be overdrawn, up to a specified amount, for a transaction fee. If the customer is using an automated teller machine ATM that is owned by a financial institution other than the one to which the account belongs, an additional fee will be charged to the account. Simple enough, you say. Or is it? In what order should these things be done? Does it matter? If the ATM is not one that is owned by the customer's financial institution, should the ATM usage fee be charged before or after checking for overdraft? If the customer's account balance is less than the ATM usage fee, charging the ATM usage fee before checking for overdraft will automatically result in an overdraft charge being applied, even if the customer decides to cancel the transaction. Is this the right behavior? With only declarative requirements, which is all that many projects have, it's impossible to say. Use cases, stated simply, allow description of sequences of events that,taken together, lead to a system doing something useful. As simple as thissounds, this is important. When confronted only with a pile of requirements, it's often impossible to make sense of what the authors of the requirements really wanted the system to do. In the preceding example, use cases reduce theambiguity of the requirements by specifying exactly when and under whatconditions certain behavior occurs; as such, the sequence of the behaviors canbe regarded as a requirement. Use cases are particularly well suited to capturing these kind of requirements. Although this may sound simple, the fact is that conventional requirement capture approaches, with their emphasis ondeclarative requirements and "shall" statements, completely fail to capturethe dynamics of the system's behavior. Use cases are a simple yet powerfulway to express the behavior of the system in way that all stakeholders caneasily understand. But, like anything, use cases come with their own problems, and as useful as they are, they can be misapplied. The result is something that is as bad, if not worse, than the original problem. Therein lies the central theme of this book--how to utilize use cases effectively without creating a greater problem than the one you started with. WHO SHOULD BE INTERESTED IN USE CASES? The short answer to this question is "just about everyone," or at least everyoneinvolved in some aspect of delivering a system that satisfies the needs ofthe customer. To be more specific about who should be interested in use cases,the following roles can benefit from the use-case technique of describing systembehavior: Customers, who need to be sure that the system that is getting built is the one that they want Managers, who need to have an overall understanding of what the system will do in order to effectively plan and monitor the project Analysts, who need to describe and document what the system is going to do Developers, who need to understand what the system needs to do in order to develop it Testers, who need to know what the system is supposed to do so that they can verify that it does it Technical writers, who need to know what the system is supposed to so that they can describe it User-experience designers, who need to understand the users' goals and how they will use the system to achieve these goals. And anyone else who wants to better understand what needs to be built before it is actually constructed HOW TO READ THIS BOOK This book is fundamentally about creating use-case models and, more importantly,about writing detailed descriptions of use cases. To remain focused onthis task, we have intentionally left out the parts of the project life cycle that use the use cases but are not directly involved in writing them. These areas include user-interface design, analysis, design, technical writing, testing, and project management. Other authors have covered a number of these areas adequately, and we felt that you, the reader, were best served if we focused narrowly on the use cases themselves. We hope you will agree.This book is intended to be a ready reference for the practitioner, the personwho is actually doing the work and grappling with the unique problemsof working with use cases. It can certainly be read cover to cover, but the realintent behind the book is to provide you with something that can continue toadd value after the first reading, providing you with a "mentor" at your fingertips. The topics presented in the book have arisen from working withcountless project teams who grappled with the same issues facing you. The book is divided into two parts. In Part I, Getting Started with Use-Case Modeling , we introduce the basics concepts of use-case modeling thatyou will need to understand in order to be effective using use cases. We conclude Part I with a description of an excellent way to get started with usecases: with a workshop. The first chapter, A Brief Introduction to Use-Case Modeling, provides practical background for people who are unfamiliar with use cases, or for people who have read other books and articles and still find themselves wrestling with the basic ideas. The purpose of the chapter is to provide a brief overview of the use-case approach without getting into a lot of formal details. The second chapter, Fundamentals of Use-Case Modeling, presents the foundations underlying the use-case modeling technique. The concepts presented here will provide the basis for the subsequent chapters in the book. The third chapter, Establishing the Vision, provides the essential tools for determining the business problem to be solved, for identifying the stakeholders in the solution, and for deciding what the system should do for those stakeholders to solve the business problem. This information is essential if we are to define the right solution when we develop our use-case model. The fourth chapter, Finding Actors and Use Cases, describes the process and subtleties of identifying the key elements of the use-case model. The purpose of this content is to help you through the sometimes-confusing task of getting started by providing a sound understanding of the basic concepts of actors and use cases. The fifth chapter, Getting Started with a Use-Case Modeling Workshop, describes the practicalities of getting started using use cases, including how to run a use-case workshop and how to deal with the practical details of starting to work with use cases. In Part II, Writing and Reviewing Use-Case Descriptions , we explore thefiner details of working with use cases, including the anatomy of a use case,how to write use-case descriptions instead of the simple but incompletedescriptions presented in Part I , and what it means to work with use cases inpractice. In these chapters, we explore in-depth how to write detailed use-casedescriptions. The sixth chapter, The Life Cycle of a Use Case, describes the transitions that a use case undergoes as it evolves from concept to complete description. This chapter establishes context for the remaining chapters and places the content of Part I into a larger context. The seventh chapter, The Structure and Contents of a Use Case, describes the various constituent parts of a use case--the basic flow, preconditions, postconditions, and the alternate flows, as well as related topics. The eighth chapter, Writing Use-Case Descriptions: An Overview, describes the objectives and challenges related to writing detailed descriptions of use cases and presents strategies for successfully mastering this challenging task. The ninth chapter, Writing Use-Case Descriptions: Revisited, discusses the mechanics of how to go about writing use-case descriptions, how to handle details, and how to structure the descriptions for readability. This is done using an evolving example in which a variety of techniques are progressively and systematically applied to improve the quality of the use-case description. The tenth chapter, Here There Be Dragons, describes the problems that most teams encounter when using relationships between use cases specifically the include, extend, and generalization relationships and relationships between actors. The eleventh chapter, Reviewing Use Cases, describes how to organize and conduct reviews of the use-case model, including a summary of areas where particular focus is needed. The final chapter, Chapter 12, Wrapping Up, touches on a number of topics related to how use cases are used in the larger context of the project, bringing our journey into the world of use cases to a close. In doing so, we provide the[ reader with a number of references to sources to consult for further information about how use cases are used in other disciplines.