The Checksum Procedure for Decision Tables (ISTQB CTAL-TA: Rule-Based Test Techniques)
Overview
Decision table testing is one of the core rule-based test techniques in the ISTQB Advanced Level Test Analyst (CTAL-TA) syllabus. Real decision tables are often minimized (collapsed) to reduce the number of rules and therefore the number of test cases. Minimizing a table merges columns using "don't care" entries, shown as "-" or "N/A".
Merging columns can introduce errors. Combinations can be lost, or two rules can end up covering the same combination. The checksum procedure is a simple arithmetic check that confirms the collapsed table still accounts for every possible combination of conditions exactly once.
Why It Is Important
The checksum matters for five reasons:
1. Completeness: It proves that no combination of conditions has been accidentally dropped while collapsing the table. A missing combination means untested business logic.
2. Consistency (no overlap): It reveals rules that overlap, where one combination is covered by two columns. If those columns specify different actions, the specification is contradictory. That is a defect you can find before any code is run.
3. Static testing value: Applying the checksum during test analysis often exposes gaps and ambiguities in the requirements. This supports early defect detection, a key Test Analyst responsibility.
4. Confidence in coverage: Decision table coverage is measured against the rules (columns). A table that passes the checksum gives a trustworthy basis for that coverage measure.
5. Exam relevance: CTAL-TA questions are K3/K4 (apply/analyze). You may be asked to verify a collapsed table, find a missing or overlapping rule, or calculate how many combinations a rule represents.
What It Is
The checksum procedure compares two numbers.
(a) The total number of possible combinations of condition values. This equals the product of the number of possible values of each condition. For n Boolean (true/false) conditions this is 2^n.
(b) The sum of the combinations represented by each rule in the collapsed table.
Each rule (column) represents a certain number of combinations:
- A rule with no "don't care" entries represents exactly 1 combination.
- Each "don't care" entry in a rule multiplies that rule's count by the number of possible values of that condition.
- For Boolean conditions, each "-" doubles the count. A rule with k dashes represents 2^k combinations.
If (b) equals (a), and no two rules match the same combination, the table is complete and non-redundant.
How It Works: Step by StepStep 1: List every condition and the number of values it can take. Boolean conditions have 2 values. Multi-valued conditions (for example, Membership = Bronze/Silver/Gold) have as many values as listed.
Step 2: Calculate the total number of combinations as the product of the value counts.
Step 3: For each rule, multiply together the value counts of the conditions marked "don't care". If a rule has no dashes, its count is 1.
Step 4: Add the rule counts together.
Step 5: Compare the result with the total:
- Sum = total: the checksum passes. The table is very likely complete with no overlaps.
- Sum < total: one or more combinations are missing.
- Sum > total: one or more rules overlap, meaning a combination is covered more than once. Check whether the overlapping rules have conflicting actions.
Worked Example 1: Boolean ConditionsA loan approval table has three conditions:
- C1: Customer has a good credit score
- C2: Customer has a stable income
- C3: Customer has collateral
The total is 2 x 2 x 2 =
8 combinations.
Collapsed table:
- R1: C1 = T, C2 = -, C3 = - (two dashes, so 2 x 2 = 4)
- R2: C1 = F, C2 = T, C3 = - (one dash, so 2)
- R3: C1 = F, C2 = F, C3 = T (no dashes, so 1)
- R4: C1 = F, C2 = F, C3 = F (no dashes, so 1)
Checksum: 4 + 2 + 1 + 1 = 8. This equals the total, so the table is complete.
Worked Example 2: A Defective TableSuppose R2 was written as C1 = -, C2 = T, C3 = -.
- R2 now counts 2 x 2 = 4.
- The new sum is 4 + 4 + 1 + 1 = 10, which is greater than 8.
- This shows an overlap. The combinations (T, T, T) and (T, T, F) are covered by both R1 and R2.
If R1 and R2 have different actions, the specification is contradictory.
Worked Example 3: Multi-Valued ConditionsA discount table has three conditions:
- Membership: Bronze, Silver or Gold (3 values)
- Order over 100: T or F (2 values)
- Coupon: T or F (2 values)
The total is 3 x 2 x 2 =
12.
Some example rule counts:
- A rule with Membership = - and Coupon = - represents 3 x 2 = 6 combinations.
- A rule with only Order = - represents 2.
The rule counts must sum to 12.
Infeasible CombinationsSome combinations are impossible. For example, "age < 18" and "age > 65" cannot both be true. You have two options:
- Keep such combinations in the table, marked as infeasible, and still include them in the checksum.
- Remove them, and then compare the sum against the total minus the number of infeasible combinations.
Either way, they must be accounted for explicitly.
Limitation to RememberA matching sum is a
necessary but not always
sufficient proof. One missing combination and one overlapping combination can cancel each other out. A careful analyst therefore also checks that no two rules can match the same combination. Two rules cannot overlap if at least one condition has contradicting values in them, for example T in one rule and F in the other.
Exam Tips: Answering Questions on The Checksum Procedure for Decision Tables- Start with the total. Always calculate the product of condition values first. For Boolean-only tables it is 2^n: 3 conditions give 8, 4 give 16, 5 give 32.
- Count dashes per column. For Boolean conditions, a column with k dashes is worth 2^k. Write the value under each column before adding.
- Watch for multi-valued conditions. A dash on a 3-valued condition multiplies by 3, not 2. This is a common trap in distractor options.
- Interpret the result correctly. A sum below the total means missing rules. A sum above the total means overlapping or redundant rules. Questions often ask "what does this indicate?"
- Identify the culprit. For a missing rule, expand each collapsed column mentally and find the combination no column covers. For an overlap, find two columns that do not contradict each other on any condition.
- Check overlap actions. If overlapping rules lead to different actions, the answer is usually "contradiction or defect in the specification". If they lead to the same actions, it is "redundancy".
- Separate combinations from test cases. The checksum counts combinations covered. The number of test cases for full decision table coverage equals the number of rules (columns) in the collapsed table, not the total combinations.
- Account for infeasible combinations. If the question mentions them, adjust the expected total accordingly.
- Remember the purpose. If asked why the checksum is used, the answer is to verify the completeness and correctness of a collapsed decision table. It is not used to derive the actions or expected results.
- Manage your time. Write the counts in a small row beneath the table on your scratch paper. This turns a K4 analysis question into simple addition and avoids careless mistakes.
SummaryThe checksum procedure follows a simple pattern:
- Total combinations = product of the condition value counts.
- Each rule's weight = product of the value counts of its "don't care" conditions.
- The sum of the rule weights must equal the total.
It is a quick, powerful way to confirm that a minimized decision table is complete and free of overlaps. It frequently reveals specification defects before testing even begins.