04 Decision Table based Testing - skylerto/Software-Testing GitHub Wiki

Decision Table-based Testing

A precise yet compact way to model complicated logic. Associate conditions with actions to perform. Can associate many independent conditions with several actions in an elegant way

Terminology

  • Condition entires restricted to binary values as we have limited entry table.
  • Condition entries have more that two values, we have extended entry.

Using Decision Tables in Software Testing

  • Condition entries in a decision table are interpreted by a computer program as input, equivalence classes of inputs.
  • Action entries in a decision table are interpreted as output, major functional processing portions.
  • The rules are then interpreted as test cases.

Decision Table Applicability

  • The specification is given or can be converted to a decision table .
  • The order in which the predicates are evaluated does not affect the interpretation of the rules or resulting action.
  • The order of the rule evaluation has no effect on resulting action .
  • Once a rule is satisfied and the action selected, no other rule need be examined.
  • The order of executing actions in a satisfied rule is of no consequence.
  • In reality, the restrictions do not eliminate many potential applications.
    • In most applications, the order in which the predicates are evaluated is immaterial.
    • Some specific ordering may be more efficient than some other but in general the ordering is not inherent in the program's logic.

Decision Tables - Issues

  • Before deriving test cases, ensure that
    • The rules are complete
      • Every combination of predicate truth values is explicit in the decision table
    • The rules are consistent
      • Every combination of predicate truth values results in only one action or set of actions

Guidelines and Observations

  • Decision Table testing is most appropriate for programs where
    • There is a lot of decision making
    • There are important logical relationships among input variables
    • There are calculations involving subsets of input variables
    • There are cause and effect relationships between input and output
    • There is complex computation logic (high cyclomatic complexity)
  • Decision tables do not scale up very well
    • May need to
      • Use extended entry decision tables
      • Algebraically simplify tables
  • Decisiontablescanbeiterativelyrefined
    • The first attempt may be far from satisfactory
  • Lookforredundantrules
    • More rules than combination count of conditions
    • Actions are the same
    • Too many test cases
  • Look for inconsistent rules
    • More rules than combinatioion count of conditions
    • Actions are different for the same conditions
  • Look for missing rules
    • Incomplete table

Decision Table Examples

Printer Troubleshooting DT

Triangle DT