Professional Documents
Culture Documents
RBT 03 2006
RBT 03 2006
Objectives
Writing Unambiguous
Requirements
PROLOG - Opening bid rules for Bridge
openbid(1.Suit) < - openpoints(bidder)
/* Bidding Rules - Opening Bid */
& longsuit(L,Suit,bidder) & eq(L,4)
& hand(bidder,S1,L1,.*.*) & le(L1,2)
openbid(0.pass) < - totpoints (P,bidder)
<(Suit,S1).
& (le(P,10) & longsuit (L,*,bidder) &
openbid(1.notrump)< - balanced(bidder) &
lt(L,7)
totpoints(P,bidder)
| ge(P,11) & le(P,12)
& ge(P,16) & le(P,18).
| eq(P,13) & quicktricks(Q,bidder) &
openbid(2.notrump) < - balanced(bidder &
lt(Q,2)).
totpoints(P,bidder)
openbid(1.Suit) < - openpoints(bidder)
& ge(P,22) & le(P,24).
& longsuit(L,Suite,bidder) & ge(L,5)
openbid(3.notrump) < - balanced(bidder) &
& next longsuit(M,*,bidder) & lt(M,5).
totpoints(P,bidder)
openbid(1.Suit) < - openpoints(bidder)
& ge(P,25) & (P,27).
& longsuit(L1,S1,bidder)
openbid(4.notrump) < - balanced(bidder) & totpoints
& next longsuit(L2,S2,bidder)
(P,Bidder)
& eq(L1,5) & (L2,5)
& ge(P,28) & le(P,29).
& ( gt(S1,S2) & Suite=S1
openbid(2.Suit) < - totpoints(P,bidder) &
| gt(S2,S1) & Suite=S2).
longsuit(L,Suit,bidder)
openbid(1.Suit) < - openpoints(bidder)
& hand(bidder, Suit,L.Pts.*) & ge(Pts,6)
& longsuit(L,Suit,bidder) & eq(L,4)
& ( eq(L,5) & ge(P,25)
& hand(bidder,Suit,L.P.*) & ge(P,4)
| eq(L,6) & ge(P,23)
& (Suit=spades | Suit=hearts).
| ge(L,7) & ge(P,21).
Copyright 2006 Bender RBT Inc. 4
• Advantages
– Rigorous Syntax
– Machine (Program) Readable
– Provable Consistency
• Disadvantage
– Not readable by the Subject Matter Experts
• Napoleon’s
Corporal
• Casper
Weinberger
• Mokusatsu
sometimes.
EXAMPLE:
Dangling Else
EXAMPLE:
“The Marriage Status must be either
Married, Single, or Divorced.”
EXAMPLE 2:
“Transaction 1 displays the customer’s name and address.
Transaction 2 displays the customer’s account numbers.
Transaction 3 displays the customer’s account balances.
Such transactions require the security code.”
Copyright 2006 Bender RBT Inc. 13
Pay Amount X X
Update Dentist X X
Update Patient X X
If it is a member dentist or an Message 2 X
Update Dentist X X
patient’s record, and print Update Patient X X
message 1. Message 2 X
Pay Amount X
Update Dentist X
Update Patient X
Message 2 X
Version 3
Copyright 2006 Bender RBT Inc. 14
Omissions
Omissions
Missing Causes
Example 1 - “If you drive through a red light
you will get a ticket.”
Missing - you must be caught doing it.
Example 2 - “If the number is 1, 3, 5, 7, 11, 13,
19, 23, or 29 it is a prime number.”
Missing - 2, 17.
Missing Effects
Example 1 - “If the account is overdrawn
reject the check.”
Missing - notify the customer.
Example 2 - “If you land on this space go
directly to jail. Do not pass go.”
Missing - do not collect $200.
Omissions
Total Omissions
• OR
• XOR
• AND
• NOR
• NAND
• IMPLICIT CONNECTORS
• CONFUSING COMPOUND
OPERATORS
OR: If A or B then C.
What people write:
“A and B each produce C.”
“A and B produce C.”
“A produces C. B also produces C.”
“If A or B or both produce C.”
“A and/or B produce C.”
“Either A or B produces C.”
“There are 2 transactions - A and B.
They each produce C.”
“A or B Result in C or D.”
Possible Interpretations:
“If A then C. If B then D.”
“If A or B then C and D.”
“If [A or B] and X then C.”
~
“If [A or B] and X then D.”
Implicit connectors:
Implicit connectors:
If [A or B] and C produce D?
OR
If A or [B and C] produce D?
[EPERM]
[EPERM]
[EPERM]
As required, As necessary
• Scope of negation
• Unnecessary negation
• Double negation
Negation
Scope of negation:
Example 1:
“If not A or B then C.”
Example 2:
“If it is not a member dentist or the code = 2
then use table one.”
Unnecessary negation:
Example 1:
Ambiguous
If the amount is not under $300 then it must not be
posted without authorization.
Clear
If the amount is $300 or more it must be authorized
before posting.
Negation
Unnecessary negation:
Example 2:
Ambiguous
If John is neither absent nor late he will get a perfect
attendance award.
ABSENT => PRESENT
LATE => ON TIME
Clear
If John is always present and always on time he will
get a perfect attendance award.
Double negation:
Examples:
Version 1
If Bob does not pass the final he will not pass the
course.
Version 2
If Bob passes the final he will pass the course.
Does version 2 have the exact same meaning as
version 1?
Copyright 2006 Bender RBT Inc. 39
Ambiguous Statements
• Ambiguous verbs
• Ambiguous variables
• Unnecessary aliases
• Ambiguous adjectives
• Ambiguous adverbs
Ambiguous verbs:
CALCULATE, UPDATE, PRODUCE, MODIFY
“If it is month end calculate the interest earned.”
Ambiguous variables:
DATA, FIELD, FILE, MESSAGE, STATUS, VALUE
“If the interest amount is greater than $100, send the
customer the notice.”
Interest accrued? Interest paid?
Interest earned? Interest anticipated?
Ambiguous Statements
Ambiguous adjectives:
Ambiguous adverbs:
Random Organization
Built-in Assumptions
Implicit Cases
Definitions:
I.E. - Id Est - That Is
E.G. - Exempli Gratia - For Example
Example
“The parolee monitoring system must maintain a
profile of the individuals (i.e., name, address,
occupation).”
Boundary Ambiguity
Answers to Exercise
Answers to Exercise
Answers to Exercise
Answers to Exercise
Answers to Exercise
Documenting Ambiguities
5. Working jointly with requirements authors,
perform “triage” on the hard ambiguities:
– Major issues (impacts architecture,
business policy):
Cannot continue until resolved.
– Significant issues (impacts single
component):
Can continue in limited areas.
– Minor issues (narrow, localized impact):
Do not affect other functions.
• Writing is accelerated.
• Critical to outsourcing