What is a use case?
Use cases are a feature of UML (Unified Modelling Language) which are used to describe key scenarios in the business domain. They are created by business analysts to document the basic functions and 'running order' of events in a system from the perspective of the user. Use cases describe what the user will do and how the system should respond to the activities and information that the user performs/provides.
How are use cases created?
Use cases and the method for their creation differs across organisations and industries but in the majority of cases they will be borne out of the initial 'requirements gathering' phase of the project. The requirements of a given project are basically a list of what the system/process needs to provide and form the basis for all future development to be based upon and traced back to. An analyst will work together with the business to document all key requirements. Following this the high level steps of the business scenarios which encompass these requirements will be documented within a use case including all the normal/sub, alternate and exceptional flows of that business scenario.
What do the different flows in a use case represent?
Primary/Normal Flow of Events:
Use cases will start by documenting the primary or 'normal' flow of events. This is likely to be the most 'well trodden path' in a particular scenario, where there are no exceptions or issues arising. An example would be a business scenario to 'Open a Customer Account' where all the necessary information is present and the user is able to complete the process with the desired outcome of, for example, 'customer account created'.
Sub Flow of Events:
A sub flow shows a different path that the primary scenario might take. For instance, in the Create Account scenario above, it would be possible to add the instruction to follow sub flow 'S1' for opening an account for a single account holder, and sub flow 'S2' when opening an account for joint account holders. Sub flows are a way of dividing the primary scenario into divergent paths whilst being able to return to the primary flow once all sub-flow activity is completed.
Alternate/Exceptional Flows:
Alternate flows document what might happen in some circumstances but would not be considered to represent the bulk of the business. An example within the Open Account scenario mentioned above would be a path the user should follow if opening an account where special circumstances (such as for instance 'power of attorney') might apply. Exceptional flows document what needs to happen in exceptional circumstances such as where all the information is not present to complete a process or where a rejection occurs.
The different flows are primarily used to ensure that the use case (and especially the primary or 'normal' flow of the use case) is as simple as it can be. Wherever possible, it is desirable for a use case to have fewer, simple, manageable flows so that it is easy to follow and visualise. There is always the option of splitting one use case into a number of use cases which link to each other by including a step to 'perform use case X' where necessary.
There are sample use cases and templates available from Alistair Cockburn's website which, at the time of writing, are available for re-use.
Another source of sample use cases, together with in-depth discussion around how to use these within a UML framework, can be found within the text documented in the sources link below.
Sources:
- http://alistair.cockburn.us/Basic+use+case+template [accessed 4 Feb 2012]
- Denis et al, Systems Analysis and Design with UML, An Object-Oriented Approach, John Wiley & Sons (Asia) Pte Ltd, 2010
Join the Conversation