Decision table testing and coverage for ISTQB CTFL
A decision table records how combinations of conditions lead to different outcomes. Conditions and actions form the rows. Each column is a decision rule: a unique combination of conditions with its actions. The coverage items are the columns holding feasible combinations, and coverage is exercised columns divided by all feasible columns, according to ISTQB's CTFL v4.0 syllabus.
How is a decision table built?
Decision tables are used to test requirements in which different combinations of conditions produce different outcomes. They are an effective way to record complex logic such as business rules.
In a limited-entry table, conditions and actions are shown as Boolean values. In an extended-entry table, some or all conditions and actions can take several values, such as ranges of numbers, equivalence partitions or discrete values.
The syllabus notation for conditions: T means the condition is satisfied, F means it is not, – means its value is irrelevant to the outcome, and N/A means the condition is infeasible for that rule. For actions: X means the action should occur and a blank means it should not.
How many columns does a full table have, and how is coverage measured?
A full decision table has a column for every combination of conditions. Three Boolean conditions give 2 x 2 x 2 = 8 columns. Two Boolean conditions and one condition with four values give 2 x 2 x 4 = 16.
Columns whose combinations cannot occur can be removed, which simplifies the table. Columns that differ only in a condition that makes no difference to the outcome can be merged into one, which minimizes it. Minimization algorithms are outside the syllabus.
Coverage is a percentage: the feasible columns that the tests exercised, over all feasible columns. A full table with 8 columns of which 2 are infeasible has 6 coverage items. Tests that exercise 3 of them give 50% coverage.
What are the strengths and limits of decision table testing?
It gives a systematic way to identify all combinations of conditions, including ones a tester could easily miss. It also exposes gaps and contradictions in the requirements.
Each added condition multiplies the number of rules, so growth is exponential and exercising every rule can take a long time. In that case the team can work from a minimized table, or choose which rules to exercise by risk.
Where the exam catches people
Dividing by every column of the full table when some are infeasible: the denominator is the number of feasible columns.
Confusing – with N/A: the dash means the condition's value does not matter for the outcome. N/A means the condition cannot apply in that rule.
Reading a blank action cell as unknown: a blank means the action should not occur.
Counting rows as coverage items: rows are conditions and actions. The coverage items are columns.
Assuming a full table always has 2 to the power of the number of conditions columns: in an extended-entry table you multiply the number of values of each condition.