Sunday, May 19, 2013

Decision tables


Decision tables are compact and precise ways of modelling complicated logic, such as that which you might use in a computer program. They do this by mapping the different states of a program to an action that a program should perform. Decision tables take on the following format:
The four quadrants
ConditionsCondition alternatives
ActionsAction entries
The limited-entry decision table is the simplest to describe. The condition alternatives are simple Boolean values, and the action entries are check-marks, representing which of the actions in a given column are to be performed.
A technical support company writes a decision table to diagnose printer problems based upon symptoms described to them over the phone from their clients. They type the following data into the advice program:
  1. Printer does print (N)
  2. Red light is flashing (Y)
  3. Printer is recognised (N)
The program then uses the decision table to find the correct actions to perform, namely that of Check / Replace ink.
Printer troubleshooter
Rules
ConditionsPrinter does not printYYYYNNNN
A red light is flashingYYNNYYNN
Printer is unrecognisedYNYNYNYN
ActionsCheck the power cable  X     
Check the printer-computer cableX X     
Ensure printer software is installedX X X X 
Check/replace inkXX  XX  
Check for paper jam X X   

No comments:

Post a Comment