Professional Documents
Culture Documents
RBT 04 2006
RBT 04 2006
Cause-Effect Graphing
• Superficially intimidating.
• Logical Operators
• Exercise
• Basic Logic Constructs
• Common Cases
• Big Exercise
• Yet Another Exercise - Graphing from Bad
Specs
• Special Cases
• Graphing Summary
1. Simple
2. Inclusive Or (…)
3. Exclusive Or (ˆ)
4. And („ )
5. Nor (‡)
6. Nxor ( ‰)
7. Nand (†)
8. Negation (ƒ)
1. Simple
– If A then B.
– If you go through a red light then you
get a ticket.
Nodes
A B
Vector
Nodes
• Variable at a State
Light is Red
Transaction Amount > Zero
• Function or an Action
If the Amount > Zero then
CALCULATE_THE_INTEREST
The User hits the Enter Button
Input Domain:
Set of all possible values for the variable(s) in
question.
Input Domain parsed (divided) into subsets by
specifying an attribute and an operator that is
applied to that attribute:
• List
• Range
• Category
2. Inclusive Or ( … )
– If A or B then C.
– If you go through a red light or pass a stopped
school bus then you get a ticket.
A B C
A
… C
B Operator
3. Exclusive Or ( ˆ )
– If one and only one of A or B then C.
– If the customer has either product A or product
B, but not both, give them product C.
A B C
A
ˆ C
B
4. And ( „ )
– If A and B then C.
– If you go through a red light and the
officer stops you, then you get a ticket.
A A B C
…
C
B
A
A B C
‡ C
B
7. Nand ( † )
– If not [A and B] then C.
– If it’s not [the Eagles and the Raiders playing]
then I’ll go to the game.
A
‡ A B C
C
B
8. Negation ( ƒ )
– If not A then B. A B
A
– If A or [not B] … C
B
then C.
Correct
A A = Rains
‡ C B = Snows
B
C = Go on a hike.
Copyright 2006 Bender RBT Inc. 19
A. A
B. C
C. B
1. Simple.
2. Compound Ifs.
3. Peer Level Ifs - (Order of the statements is not
important).
4. Nested Ifs - (Order of the statements is
important).
5. Case Statement.
B
– If A, then B; else C. A
ƒ C
1. Simple (continued) B
– If A, then B, C, and D. A C
D
B
C
– If A, then B, C, and D; else A
D
E. ƒ
E
Display M essage
Correct -
Error Reset Cursor
Highlight Field
2. Compound If
– If A or B or C, then D.
A A
B … D B … D
C C
Caution: Stop the
vector at the arc
2. Compound If (continued)
A E
ƒ
B … D
C
…
F
E
A
C Intermediate
… Nodes
B
Primary „ G
Causes
D
Primary
… Effects
F
E
Y-E
„
Change
Notice
T/ C 2
…
R-O/ A
M-E
Copyright 2006 Bender RBT Inc. 37
or
[If Q and R]
or Í the “or” relationship is assumed and must be checked.
[If S and not Q]
then C. Copyright 2006 Bender RBT Inc. 38
Incorrect Correct
A A I1
„
B „ B
… X … … X
C C I2
„
„
D D I3
If A Or B A
ERROR1
Then C ƒ
… C
If C And D ERROR2
B ƒ
Then E „ E
If E And F D ƒ
ERROR3
Then G „ G
Else Error3 F
Else Error2
Else Error1.
Copyright 2006 Bender RBT Inc. 40
… C ERROR2
„
ƒ
B
„ E ERROR3
„
ƒ
D
„ G
F
Copyright 2006 Bender RBT Inc. 41
A ERROR1 A
‡
ERROR1
ƒ
… C
… C ERROR2
ERROR2
„ ƒ
ƒ B
B „ E
„ E D
D
ERROR 2: C True and D
ERROR 2: C True and D False; C False and D True;
False. C False and D False.
Copyright 2006 Bender RBT Inc. 42
4. Nested Ifs
(continued) A ‡
ERROR1
If A Or B
Then C … C ERROR2
Implicit „
If D Or E “and” B
ƒ
Then F F
„
Else Error2 D
Else Error1. …
I1
E
“ and” Implicit
In Specification
A B „ E
„ E …
B C F
A
… F
C
Vs.
1. State Machines
2. Looping Logic
3. Real Time Systems
4. Alternate Paths
5. Asynchronous Processing
C3 Si S1 S2
Si „ ƒ „
„ S3 C1
PREV.
S1 S2
„
S2 C2 „
C1 „
S3
C2
„ C
B < 1 Sec A
Paths X
A1
A3
A5
A
A2
A4
B1
B3
B5
B
B2
B4
Copyright 2006 Bender RBT Inc. 53
B1
B3
.C.(Sync
A 6
. Point)
B
...
B5
B2
B4
Copyright 2006 Bender RBT Inc. 54
HAN G UP
Phone Connected
On Hook DIAL
CORRECT,
PICK NUM BER DIAL
NO DIAL UP PHONE ANSWERED NUM BER,
TONE, PHONE
HAN G DIAL IN USE
UP TONE Ready Busy
Phone To Call
Off Hook
DIAL
NUM BER,
DIAL NO ANSWER
HAN G UP INCORRECT Ringing
Wrong NUM BER,
Forever
ANSWERED
Number
HAN G UP
If neither Sally nor Sarah are going to the party then Harry will
not go either. If Sarah and John go, Harry will not go. If Sally
and Bob go, Harry will not go. Otherwise, Harry will go.
Code 1 Report 1
Report 1
Code 1
„ Report 3
„ Report 3
Code 2 Report 2 Code 2
Version 2 Report 2
Version 3
(less correct)
I1
Account Open „ Govt. Stmt.
„ Listen On Radio
ƒ
ƒ
„
Day Off Go For Hike
„ƒ
ƒ
Actually Work
Acct. Bal.
Numeric
ƒ
Error M sg3
Copyright 2006 Bender RBT Inc. 74
…
I1 …
Process
Transaction
B Acct. Bal.
Numeric
Copyright 2006 Bender RBT Inc. 78
have retried 5
times. After 5
…
5 Retries Terminate
So Far
retries terminate
the fax. Version 1
8. Fax … Successful
Busy
… Terminate
…
5 Retries Start Timer
So Far ƒ
…
Retry
Version 2 1 M inute
9.
Case MODE-OF-BILLING
If it is a PREPAID-SHIPMENT Prepaid Accrue 100%
Then Immediately
ACCRUE_100%_IMMEDIATELY.
If it is a STANDARD-BILLING Standard Accrue 100%
Then … In 14 Days
ACCRUE_100%_IN_14_DAYS. COD …
If it is a COD-SHIPMENT and a WHOLESALE- I1
CUSTOMER
Then
ACCRUE_100%_IN_14_DAYS.
If it is a COD-SHIPMENT and a RETAIL-
CUSTOMER Wholesale
Then …
ACCRUE_80%_IMMEDIATELY. Retail Accrue 80%
Otherwise Immediately
No Other Cases Possible
EndCase.
11.
„
„
ƒ „
ƒ „
„ ‡
„
ƒ
ƒ
HAN G UP
Phone Connected
On Hook DIAL
CORRECT,
PICK NUM BER DIAL
NO DIAL UP PHONE ANSWERED NUM BER,
TONE, PHONE
HAN G DIAL IN USE
UP TONE Ready Busy
Phone To Call
Off Hook
DIAL
NUM BER,
DIAL NO ANSWER
HAN G UP INCORRECT Ringing
Wrong NUM BER,
Forever
ANSWERED
Number
HAN G UP
I1
Double Click