John M. Battista

353days since
Our Anniversary

Recent site activity

Use Cases

A use case is a mechanism for recording the behavior of some system. It consists of a set of stakeholders with goals and shows the scenarios that may play out in completing those goals, the Main Success Scenario and Extenstions--alternate success scenarios and error cases. It provides a well defined method for producing requirements that fulfills several important criteria when properly written.

  1. Clear concise description of behavior
  2. Aids the requirements writer in capturing the extensions, via proper writing strategy as described by Alistair Cockburn in Writing Effective Use Cases
  3. Assists developers in easily selecting the smallest possible units of behavior to implement - ie. a Main Success Scenario or an Extension
  4. Provides a clear road map for developing system tests - a major failing of 1.1) shall do ... requirements lists

Guidelines for Writing use Cases

The following guidelines are excerpts from Writing Effective Use Cases by Alistair Cockburn, used with permission.

Reminders

Write something readable.

    Casual, readable use cases are still useful, wheras unreadable use cases won't get read.

Work breadth-first, from lower precision to higher precision.

    Precision Level 1: Primary actor's name and goal
    Precision Level 2: The use case brief, or the main success scenario
    Precision Level 3: The extension conditions
    Precision Level 4: The extension handling steps

For each step:

    Show a goal succeeding.
    Capture the actor's intention, not the user interface details.
    Have an actor pass information, validate a condition, or update state.
    Write between-step commentary to indicate step sequencing (or lack of).
    Ask 'why' to find a next-higher level goal.

For data descriptions (only put Precision Level 1 into the use case text):

    Precision Level 1: Data nickname
    Precision Level 2: Data fields associated with the nickname
    Precision Level 3: Field types, lengths and validations

The Writing Process

  1. Name the system scope and boundaries.
    Track changes to this initial context diagram with the in/out list.
  2. Brainstorm and list the primary actors.
    Find every human and non-human primary actor, over the life of the system.
  3. Brainstorm and exhaustively list user goals for the system.
    The initial Actor-Goal List is now available.
  4. Capture the outermost summary use cases to see who really cares.
    check for an outermost use case for each primary actor.
  5. Reconsider and revise the summary use cases. Add, subtract, or merge goals.
    Double-check for time-based triggers and other events at the system boundary.
  6. Select one use case to expand.
    Consider writing a narrative to learn the material.
  7. Capture stakeholders and interests, preconditions and guarantees.
    The system will ensure the preconditions and guarantee the interests.
  8. Write the main success scenario (MSS).
    Use 3 to 9 steps to meet all interests and guarantees.
  9. Brainstorm and exhaustively list the extension conditions.
    Include all hat the system can detect and must handle.
  10. Write the extension-handling steps.
    Each will end back in the MSS, at a separate success exit, or in failure.
  11. Extract complex flows to sub use cases; merge trivial sub use cases.
    Extracting a sub use case is easy, but it adds cost to the project.
  12. Readjust the set: add, subtract, merge, as needed.
    Check for readability, completeness, and meeting stakeholders' interests.

Pass/Fail Tests for Use Case Fields

 Field Question
 Use Case Title
1. Is it an active-verb goal-phrase that names the goal of the primary actor?
 2. Can the system deliver that goal.
 Scope and Level
3. Are the fields filled in?
Scope
4. Does the use case treat the system mentioned in the Scope as a black box? (The answer must be "Yes" if it is a system requirements document, but may be "No" if the use case is a white-box business use case.) 

5. If the system in Scope is the system to be designed, do the designers have to design everything in it and nothing outside it.
 Level6. Does the use case content match the stated goal level?
 7. Is the goal really at the stated level?
 Primary Actor
8. Does he/she/it have behavior?
 9. Does he/she/it have a goal against the SuD that is a service promise of the SuD
 Preconditions10. Are they mandatory, and can they be set in place by the SuD?
 11. Is it true tat they are never checked in the use case?
 Stakeholders and interests
12. Are they named and must the system satisfy their interests as stated? (usage varies by formality and tolerance).
 Minimal Guarantees   
13. Are all the stakeholder's interests protected?
 Success Guarantees
14. Are all the stakeholder's interests satisfied?
 Main Success Scenario
15. Does it have 3-9 steps?
 16. Does it run from trigger to delivery of the success guarantee?
 17. Does it permit the right variations in sequencing?
 Each step in any scenario
18. is it phrased as a goal that succeeds?
 19. Does the process move distinctly foward after its successful completion?
 20. Is it clear which actor is operating the goal--who is "kicking the ball"?
 21. Is the intent of the actor clear?
 22. Is the goal level of the step lower than the goal level of the overall use case? Is it, preferably, just a bit below the goal level?
 23. Are you sure the step does not describe the user interface design of the system?
 24. Is it clear what information is being passed in the step?
 25. Does it "validate," as opposed to "check" a condtion?
 Extension Condition
26. Can and must the system both detect and handle it?
 27. Is it what the system actually needs?
 Technology and Data Variation List
28. Are you sure this is not an ordinary behavioral extension to the Main Success Scenario
 Overall use Case Content
29. To the sponsors and users: "Is this what you want?"
 30. To the sponsors and users: "Will you be able to tell, upon delivery, whether you got this?"
 31. To the developers: "Can you implement this?"