February 2006 Technical Tip – Decision Tables

Narratives, like people, can be guilty of two types of sins: omission and commission. Errors of commission (saying the wrong thing) are generally pretty easy to identify in a narrative. The same cannot be said for errors of omission (leaving something out.) A decision table is a terrific tool for showing logic in a non-ambiguous format while making it easier to identify errors of omission. Consider the following simple narrative such as you might receive with a process mini-spec (used in traditional systems analysis and design) or with a use case (used in object oriented analysis and design):

If I am going out with my girl, I'll consent to a chick flick.
But if I am with the guys, we want to see things getting blown up!
Under no circumstances will I watch a foreign film.

A decision table consists of a list of conditions followed by a list of actions. Each column shows a combination of conditions and actions: these rules are often numbered for convenience in referencing.

In its purest form the conditions will always be Y or N, and the actions will be X or blank. If there are n conditions, there will be 2n rules. For example:

 

Rules

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

Conditions

foreign film

Y

Y

Y

Y

Y

Y

Y

Y

N

N

N

N

N

N

N

N

with the guys

Y

Y

Y

Y

N

N

N

N

Y

Y

Y

Y

N

N

N

N

chick flick

Y

Y

N

N

Y

Y

N

N

Y

Y

N

N

Y

Y

N

N

explosions

Y

N

Y

N

Y

N

Y

N

Y

N

Y

N

Y

N

Y

N

Actions

yes                    

X

   

X

   

no

X

X

X

X

X

X

X

X

 

X

 

X

   

X

X

 

The action is missing for rules 9 and 13. Can a movie be a chick flick with explosions? What about a James Bond movie? For the guys, there are usually plenty of things getting blown up, and the right girl might find herself feeling amorous after watching Sean or Pierce. These rules represent an error of omission not addressed by our narrative. Time to consult our SMEs…

A decision table can often be compressed. Notice the outcomes for rules 1-8 is N because foreign film = Y. If it's a foreign film, nothing else matters. This is often shown with a hyphen as follows:

 

Rules

1

2

3

4

5

6

7

8

Conditions

foreign film

Y

N

N

N

N

N

N

N

with the guys

-

Y

Y

Y

Y

N

N

N

chick flick

-

Y

Y

N

N

Y

Y

N

explosions

-

Y

N

Y

N

Y

N

-

Actions

yes

     

X

   

X

 

no

X

 

X

 

X

   

X

 

Sometimes the Y/N constraint for conditions becomes confusing. A decision table to determine car insurance rates might ask about the number of moving violations received: 0, 1-2, or 3+. The following condition stubs are equivalent:

no tickets

Y

N

N

1-2 tickets

N

Y

N



tickets?

0

1-2

3+

 

The actions are not limited to a single X as shown in the following partial table:

 

Rules

1

2

3

4

5

6

7

8

Conditions

Mainframe

Y

Y

           

Business appl

Y

Y

           

Batch

Y

N

           
                 
                 

Actions

COBOL

X

X

           

JCL

X

             

CICS

 

X

           
                 

 

If you'd like to know more IT best practices, then talk to the IT industry's best trainers. You'll find them at Caliber Data Training.


Go to the articles index. Written by Bill Qualls. Copyright © 2006 by Caliber Data Training 800.938.1222