Vague and ambiguous use cases

How abstract should your specs be?

Internet Security Threat Report 2014

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). ®

Security for virtualized datacentres

More from The Register

next story
Microsoft WINDOWS 10: Seven ATE Nine. Or Eight did really
Windows NEIN skipped, tech preview due out on Wednesday
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
'Google is NOT the gatekeeper to the web, as some claim'
Plus: 'Pretty sure iOS 8.0.2 will just turn the iPhone into a fax machine'
prev story


Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.