Decision table

Last updated
Play golf dataset
Independent variablesDep. var
OutlookTemperatureHumidityWindyPlay
sunny8585FALSEDon't play
sunny8090TRUEDon't play
overcast8378FALSEPlay
rain7096FALSEPlay
rain6880FALSEPlay
rain6570TRUEDon't play
overcast6465TRUEPlay
sunny7295FALSEDon't play
sunny6970FALSEPlay
rain7580FALSEPlay
sunny7570TRUEPlay
overcast7290TRUEPlay
overcast8175FALSEPlay
rain7180TRUEDon't play

Decision tables are a concise visual representation for specifying which actions to perform depending on given conditions. Decision table is the term used for a Control table or State-transition table in the field of Business process modeling; they are usually formatted as the transpose of the way they are formatted in Software engineering.

Contents

Overview

Each decision corresponds to a variable, relation or predicate whose possible values are listed among the condition alternatives. Each action is a procedure or operation to perform, and the entries specify whether (or in what order) the action is to be performed for the set of condition alternatives the entry corresponds to.

To make them more concise, many decision tables include in their condition alternatives a don't care symbol. This can be a hyphen [1] [2] [3] or blank, [4] although using a blank is discouraged as it may merely indicate that the decision table has not been finished.[ citation needed ] One of the uses of decision tables is to reveal conditions under which certain input factors are irrelevant on the actions to be taken, allowing these input tests to be skipped and thereby streamlining decision-making procedures. [5]

Demonstration of “don’t care” symbol
Rules
ConditionsFeeling energetic?YesNoYesNo
Is raining?YesYesNoNo
ActionsStay insideBrown check.svgBrown check.svg
Go runningBrown check.svg
Tend the gardenBrown check.svgBrown check.svg
Rules
ConditionsFeeling energetic?YesNo
Is raining?YesNoNo
ActionsStay insideBrown check.svg
Go runningBrown check.svg
Tend the gardenBrown check.svgBrown check.svg
The two tables convey identical information, but the second one uses a hyphen as a don't-care symbol for brevity.

Aside from the basic four quadrant structure, decision tables vary widely in the way the condition alternatives and action entries are represented. [6] [7] Some decision tables use simple true/false values to represent the alternatives to a condition (similar to if-then-else), other tables may use numbered alternatives (similar to switch-case), and some tables even use fuzzy logic or probabilistic representations for condition alternatives. [8] In a similar way, action entries can simply represent whether an action is to be performed (check the actions to perform), or in more advanced decision tables, the sequencing of actions to perform (number the actions to perform).

A decision table is considered balanced [4] or complete [3] if it includes every possible combination of input variables. In other words, balanced decision tables prescribe an action in every situation where the input variables are provided. [4]

Example

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.

The following balanced decision table is an example in which a technical support company writes a decision table to enable technical support employees to efficiently diagnose printer problems based upon symptoms described to them over the phone from their clients.

Printer troubleshooter
Rules
ConditionsPrinter printsNoNoNoNoYesYesYesYes
A red light is flashingYesYesNoNoYesYesNoNo
Printer is recognized by computerNoYesNoYesNoYesNoYes
ActionsCheck the power cableBrown check.svg
Check the printer-computer cableBrown check.svgBrown check.svg
Ensure printer software is installedBrown check.svgBrown check.svgBrown check.svgBrown check.svg
Check/replace inkBrown check.svgBrown check.svgBrown check.svg
Check for paper jamBrown check.svgBrown check.svg

This is just a simple example, and it does not necessarily correspond to the reality of printer troubleshooting. Even so, it demonstrates how decision tables can scale to several conditions with many possibilities.

Software engineering benefits

Decision tables, especially when coupled with the use of a domain-specific language, allow developers and policy experts to work from the same information, the decision tables themselves.

Tools to render nested if statements from traditional programming languages into decision tables can also be used as a debugging tool. [9] [10]

Decision tables have proven to be easier to understand and review than code, and have been used extensively and successfully to produce specifications for complex systems. [11]

History

In the 1960s and 1970s a range of "decision table based" languages such as Filetab were popular for business programming.

Program embedded decision tables

Decision tables can be, and often are, embedded within computer programs and used to "drive" the logic of the program. A simple example might be a lookup table containing a range of possible input values and a function pointer to the section of code to process that input.

Static decision table
InputFunction Pointer
"1"Function 1 (initialize)
"2"Function 2 (process 2)
"9"Function 9 (terminate)

Control tables

Multiple conditions can be coded for in similar manner to encapsulate the entire program logic in the form of an "executable" decision table or control table. There may be several such tables in practice, operating at different levels and often linked to each other (either by pointers or an index value).

Implementations

See also

References

  1. LI Jing (1 April 2015). "SEEM 3430 Tutorial: Decision Tables" (PDF). p. 23. Archived from the original (PDF) on 22 December 2018. Retrieved 11 November 2017.
  2. "Creating a Decision Table in Business Rules". Oracle Help Center. 6 August 2017. Retrieved 11 November 2017.
  3. 1 2 Ross, Ronald G. (2005). "Decision Tables, Part 2 ~ The Route to Completeness". Business Rules Journal. 6 (8). Retrieved 11 November 2017.
  4. 1 2 3 Snow, Paul (19 July 2012). "Decision Tables". DTRules: A Java Based Decision Table Rules Engine. Retrieved 11 November 2017.
  5. LI Jing 2015, p. 24-25.
  6. Rogers, William T. "Decision Table Examples: Medical Insurance". Saint Xavier University Systems Analysis and Design. Archived from the original on March 29, 2007.
  7. "Decision tables". Archived from the original on 2012-09-08. Retrieved 2010-07-07.
  8. Wets, Geert; Witlox, Frank; Timmermans, Harry; Vanthienen, Jan (1996). "Locational choice modelling using fuzzy decision tables". New frontiers in fuzzy logic and computing: 1996 biennial conference of the North American Fuzzy Information Processing Society – NAFIPS. Berkeley, CA: IEEE. pp. 80–84. doi:10.1109/NAFIPS.1996.534708. ISBN   0-7803-3225-3. S2CID   62056954.
  9. "A Real CCIDE Example"
  10. "Experience With The Cope Decision Table Processor". Archived from the original on 2017-05-04. Retrieved 2010-07-07.
  11. Udo W. Pooch, "Translation of Decision Tables," ACM Computing Surveys, Volume 6, Issue 2 (June 1974) Pages: 125–151 ISSN   0360-0300
  12. "FORTAB: A Decision Table Language for Scientific Computing Applications", 1962, Rand
  13. Alexander Williams (2015). "Ruby decision table parser"

Further reading