Seilevel
Seilevel Home
Back to Blog Home - Requirements Defined

Thursday, April 17, 2008

Best Practices with Use Cases

This may be a lot of review for seasoned use case writers, but for those of you who are not as familiar with this requirements model, here are some best practices to consider. I assume you already know what a use case is, why you would want to use them, and the components that make up a proper use case. I've included some helpful links at the bottom of the post for more information.

Use a Template
A bit of a no-brainer, but I'm surprised at how many different use cases I see across projects at the same company (or even within the same project). Templates make your job easier, but even more importantly they make it easier for your readers.

Make Pre & Post Conditions Verifiable
Pre and Post Conditions should be written as testable statements. "User has logged in" is much clearer than "Log in". Also - if you have multiple conditions, they should be separated with an And or Or, as appropriate.

Adhere to Consistent Writing Standards
This is particularly important if multiple people are writing use cases on the same project - they should all use the same writing format, style, sentence structure, etc... Consider the following:
  • Single statement per line
  • Always have a subject - "User" or "System"
  • Be concise - remember, use cases are not end requirements - you should be demonstrating the interaction between the system and user, but not detailed specifications
  • Use an active voice
Do Not Include Design
Many use cases become less effective (or even un-readable) because the author attempts to put everything they can in the use case. Detailed specifications - particularly design elements such as button names - should not be in use cases unless there is a very good reason (and usually there is not).

Use an Appropriate Level of Detail
I can suggest some guidelines, but you will have to find what the "right" level of detail is for your own situations. Keep in mind these suggestions:
  • Generally, use cases should be 10-15 steps in length
  • If you find yourself repeating the same set of steps on multiple use cases, consider separating them out into their own use case
  • If you have a use case with just a handful of steps, consider folding it into another use case(s)
  • If you have many use cases that have essentially the same set of steps, make sure you are not writing different use cases for scenarios that describe the same interaction (e.g. if you have a use case for Purchase Music CD and Purchase DVD and they describe the same interactions, then you probably are capturing scenarios instead of unique use cases)
More Reading on Use Cases
Check out the following for more information:
Requirements Defined Newsletter Bookmark and Share

1 Comments:

Blogger James Taylor said...

And don't embed business rules in the use case! Business rules are not requirements and should be externalized from use cases at each decision point within the use case. Check out this presentation for some specifics.
JT

James Taylor
Author of Smart (enough) Systems

3/24/2008 12:41 PM  

Post a Comment

<< Home