Feeds

Vague and ambiguous use cases

How abstract should your specs be?

5 things you didn’t know about cloud backup

Column Programmers are often frustrated when well-meaning managers or architects attempt to introduce some OOAD [note that the process in my link isn't necessarily the same as the Iconix process Matt alludes to - Ed] into their projects.

Often the reason for this frustration is subtle, and has nothing to do with OOAD as such - it's that they've been given vague and ambiguous requirements to design from. And the reason for so much ambiguity is that so many of the books and gurus out there preach "abstract, essential, technology-free, and implementation-independent" as the right way to write use cases.

Representation of Vague and Ambiguous Use Cases

To illustrate...

Which of these two use case scenarios would you prefer to create a design from?

  1. The clerk enters basic loss information specific to the claim line. The system confirms that there are no existing, possibly competing claims and assigns a claim number. The clerk confirms they are finished; the system saves and triggers acknowledgement to be sent to the agent.
  2. The system displays the Basic Loss Information Page, with a form to enter basic loss information specific to the claim line. The clerk fills out the form then clicks the "Add" button. The system queries the claims database to confirm that there are no existing, possibly competing claims. The system then assigns an ID to the claim and displays the confirmation page. The clerk clicks the "Confirm" button, and the system saves the claim, then triggers acknowledgement to be sent to the agent.

(For brevity's sake, I'm omitting the all-important "rainy day scenarios"; such as what the system should do if an existing, competing claim is discovered).

Example 1 is excerpted, and slightly mangled to fit into the context of this article, from a longer use case description in Alistair Cockburn's Writing Effective Use Cases. Example 2 is my attempt at rewriting the first one to be less vague and ambiguous.

Example 1 is an "essential", abstract, technology-free and implementation-independent use case description. In fact, it's closer to a business process description as it has a lot to say about the details of a business transaction but very little (nothing, in fact) about precisely how the user and the system will interact. In other words, it's entirely divorced from the technical or UI details.

By contrast, Example 2 is more of a detailed usage description: a low-level scenario. So to an extent, we're talking "horses for courses" - different styles for different purposes.

But if you're defining the business and purely the business (as in Example 1) - to be brutally honest you probably don't want to do this with use cases - you'd do better to write business process descriptions, which tend to be broader in scope (one use case is typically a "discrete packet of functionality", i.e. quite fine-grained).

But having defined your business processes, there's a mighty leap to get from there to an architecture and detailed design. This is where Example 2 comes in, a set of use case scenario descriptions with concrete, tangible and specific statements of required system behaviour that programmers can deal with efficiently.

As you've probably gathered, my own preference is for the second example, because it's far more explicit. So instead of showing a page/screen/unspecified UI component with information about basic loss information, the system is displaying a Basic Loss Information Page. It gives the developers a specific name to refer to.

To illustrate this, in the second example I've bolded the terms that would end up as domain objects, actors or pages/screens, which then get used in the detailed design. In doing so, I noted that Basic Loss Information could be an entity class, or even be a set of attributes on a Claim entity class. This all helps to tighten up your behavioural spec, and it's a tangible benefit of tying your use cases to your objects.

By writing your use cases using a concrete, unambiguous style, you end up with a rigorous specification of how the user and the system will interact (with an additional, higher-level description of the business processes, if the project calls for it). From a behavioural spec of this sort, it's then much easier to design and create a comprehensive set of unit tests, and to create realistic estimates.

(The diagram at the top of this article appears in the Preface to my latest snappily titled blockbuster co-authored with Doug Rosenberg, Use Case Driven Object Modeling with UML: Theory and Practice, which walks you through the OOAD process I've alluded to in this article). ®

Secure remote control for conventional and virtual desktops

More from The Register

next story
Why has the web gone to hell? Market chaos and HUMAN NATURE
Tim Berners-Lee isn't happy, but we should be
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Sin COS to tan Windows? Chinese operating system to debut in autumn – report
Development alliance working on desktop, mobe software
Microsoft boots 1,500 dodgy apps from the Windows Store
DEVELOPERS! DEVELOPERS! DEVELOPERS! Naughty, misleading developers!
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

A new approach to endpoint data protection
What is the best way to ensure comprehensive visibility, management, and control of information on both company-owned and employee-owned devices?
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Maximize storage efficiency across the enterprise
The HP StoreOnce backup solution offers highly flexible, centrally managed, and highly efficient data protection for any enterprise.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.