Ambiguity and the Right Level of Detail
In short There is no universal right level of detail. Leffingwell and Widrig describe a sweet spot where understanding is highest and ambiguity lowest, and its position depends on how costly a misreading would be and how capable the implementers are. Three simple heuristics help you find ambiguity before it reaches code.
Based on: D. Leffingwell, D. Widrig, Managing Software Requirements: A Unified Approach, ch. 26, which draws on D. Gause and G. Weinberg, Exploring Requirements.
On this page
Key ideas#
The sweet spot#
Leffingwell and Widrig say the question they hear most often is how detailed a requirement must be to avoid misunderstanding. There are two ways to miss:
- Too little detail. Ambiguity rises until nobody can tell what is meant.
- Too much detail. Understanding drops again. Users will not read an overloaded specification, and implementers lose sight of the purpose among the details.
The target is the zone where the requirement is both understandable and unambiguous.
The blinking-lamp example#
Take a requirement for a two-lamp box: if either lamp fails, the other must blink once per second. It sounds clear until the programmer has to choose a duty cycle. Half a second on and half off, or nine-tenths on and one-tenth off? Both blink once per second. For a simple indicator, nobody cares. If the same kind of vagueness describes the power output of a surgical instrument, it could harm a patient.
The authors conclude that the right level of detail depends on two things:
- The consequences of a misreading in this application.
- The implementers’ ability to make good choices on their own, or to ask in time.
“Mary had a little lamb”#
Leffingwell and Widrig borrow an exercise from Gause and Weinberg. Look up the dictionary meanings of two words in that familiar line, “had” and “lamb”. “Had” ranges from “owned” to “bribed”; “lamb” ranges from a young sheep to a person who is easily fooled. Combined, they give more than a dozen legitimate readings. A phrase that feels perfectly clear to people who share a background can mean something else to people who do not, and that is exactly the position of developers reading users’ requirements.
Three heuristics for finding ambiguity#
These come from Gause and Weinberg, as presented by Leffingwell and Widrig:
- Memorization. Ask several people, from development and from the business, to write the requirement down from memory. The parts they struggle to reproduce exactly are probably ambiguous. Rewrite those parts.
- Keywords. Pick the key words, write out their possible meanings from an authoritative source, combine the readings, and check that exactly one is intended.
- Emphasis. Read the requirement aloud several times, stressing a different word each time. Each stress can reveal a different reading. If only one reading is intended, rewrite to make it explicit; if several are valid, you may need separate requirements.
Where misunderstanding is unacceptable, move to formal methods such as pseudocode, state machines or decision tables.
The authors’ recommendations#
- Use natural language wherever you can.
- Add pictures and diagrams.
- Ask when in doubt, and ask even when you feel no doubt.
- Use formal methods where a misreading is unacceptable.
- Train the team to recognize ambiguity, not just to fix individual cases.
How to apply it#
- Rate the risk. For each requirement area, ask how bad a misreading would be (annoying, costly, dangerous) and how well the implementers know the domain.
- Set the detail level. High risk with implementers new to the domain calls for the most detail, models or formal methods. Low risk with experienced implementers who can easily ask needs short statements plus conversation.
- Pick the risky items and run the emphasis heuristic in a short review.
- Run the memorization check with one business person and one developer for the most important items.
- Run the keyword check on terms that appear in many requirements, and put the agreed meanings in the glossary.
- Escalate to a diagram, a decision table or a prototype where ambiguity remains.
Example#
The Workshop, a fictional bike-repair chain, has this requirement: “Notify the customer when the bike is ready.” An emphasis read-through finds:
- Notify — by SMS, email, phone call or app message?
- the customer — the person who booked, or the bike’s owner (a parent booking for a child)?
- when — immediately, or only during opening hours?
- the bike — one bike, or all bikes in a multi-bike booking?
- is ready — repair finished, safety check signed off, or paid?
Rewrite: “When a mechanic signs off the final safety check on the last open repair job in a booking, the system shall send the person who made the booking an SMS and an email saying the bikes can be collected. Messages generated outside opening hours shall be sent at the next opening time.”
Pitfalls#
- Relying on friendly read-throughs. Each reader sees one reading and is satisfied. Use the heuristics or a formal review.
- One detail level for everything. Safety-relevant or contractual areas need more; well-understood areas need less.
- Over-specifying for experts. Burying an experienced team in detail makes them lose the purpose.
- Treating ambiguity as a writing problem only. Some ambiguity is a missing decision; find who must make it.
Sources and further reading#
- D. Leffingwell, D. Widrig. Managing Software Requirements: A Unified Approach. Addison-Wesley, 2000, ch. 26.
- D. Gause, G. Weinberg. Exploring Requirements: Quality Before Design. 1989 — source of the “Mary had a little lamb” exercise and the memorization, keyword and emphasis heuristics.