ISTQB CTAL-TA study materials
ISTQB CTAL-TA study resources

Eight Test Cases for a Four-Condition Discount

ISTQB CTAL-TA · Put your knowledge to work in context.

All case studies

Eight Test Cases for a Four-Condition Discount

A travel-insurance quote engine applies a family discount under four rules: (1) customer age 18–70 inclusive; (2) trip duration 1–45 days; (3) if age is 65 or over, trip duration must be 30 days or less; (4) the discount applies when family policy = Y and there are at least two travellers. A junior analyst has submitted eight test cases, one per rule, each holding the other three conditions at a valid value. The submission claims 'complete coverage of the discount logic'. The full regression suite must run in 90 minutes, and the team is reluctant to add cases.

1. Critique the eight test cases. What test conditions are missing, and is the coverage claim defensible?

Read the worked answer

The claim is not defensible. Eight cases that each vary one condition against a fixed happy-path background demonstrate that each rule can work, not that the rules interact correctly.

Specific gaps:

  • Rule 3 is dependent on rule 1 and rule 2. The junior analyst exercised 'age 65+ → duration ≤ 30' in isolation. The interesting cases are the combinations: age 68 with duration 40 (an invalid quote that must be rejected, not priced), and age 64 with duration 40 (must be accepted). Nothing in the suite distinguishes them, so a defect that drops the age/duration dependency entirely would still pass.
  • Rule 4 interactions are untested. Family = Y with one traveller, family = N with four travellers, and the same combinations at age 66 - none appear.
  • The infeasible region has never been discussed. Age 65–70 combined with duration 31–45 cannot satisfy rules 1–3 together. Is that an intended rejection with a defined message, or a specification gap? The analyst's suite hides the question rather than raising it.
  • Boundaries are absent. Ages 17, 18, 70, 71 and durations 0, 1, 45, 46 never appear; the internal boundary at 64/65 and at 30/31 is the one rule 3 creates.

A useful test condition is a combination of attribute values that must produce a defined outcome. Eight single-variable cases do not approximate that.

2. Which technique would you apply, what coverage would you claim, and roughly how many test cases result? Justify the numbers.

Read the worked answer

Technique: decision table testing, because the logic is a set of conditions combining into defined actions, with a dependency.

Derivation. Treat the conditions as binary:

Condition Values
Age band 18–64 / 65–70
Duration band 1–30 / 31–45
Family policy Y / N
Travellers ≥2 / <2

Four binary conditions give 2⁴ = 16 rules. The age ≥65 ⇒ duration ≤30 constraint makes the combination (age 65–70, duration 31–45) infeasible, which removes 2 × 2 = 4 rules, leaving 12 feasible rules. Full decision-table coverage therefore needs 12 test cases: every feasible rule produces exactly one case, including the four rules where the discount applies and the eight where it does not.

If 12 cases will not fit the 90-minute suite, that is an effort decision, not a testing-technique decision. Options, in order of preference:

  1. Keep all 12 - this is a small engine and the suite cost is minutes, not hours.
  2. Collapse rules whose action is identical and whose conditions are irrelevant to that action, using don't-care entries - this usually removes several of the no-discount rules legitimately.
  3. Fall back to pairwise across the four parameters, roughly five or six cases, and state in the coverage note that three-way and four-way interactions are no longer covered.

What must not happen is claiming 'complete coverage' while running eight single-variable cases.

3. How would you add boundary value analysis to this, and what would you do with the dependent rule while doing so?

Read the worked answer

Boundaries sit at both the range limits and at the internal limits the dependency introduces.

Boundaries to analyse:

  • Age: 17/18 and 70/71 for the stated range, plus 64/65 for rule 3. The 64/65 boundary is the one most likely to be implemented with a > instead of a >=.
  • Duration: 0/1 and 45/46, plus 30/31 for the same dependency.
  • Travellers: 1/2 - the 'at least two' threshold.

Two-value or three-value? For domain validation where an off-by-one is the plausible defect, three-value BVA (17, 18, 19 …) gives more evidence at low cost on a small engine; for the discount threshold itself, two-value is sufficient because the behaviour on each side is what matters, not the interior.

Handling the dependent rule. Boundaries cannot be analysed one variable at a time here. The 30/31 duration boundary is only meaningful when age is 65–70; at age 40 it is a harmless value. So I would pair each boundary case with the two relevant age contexts - one just below the dependency (age 64) and one inside it (age 66) - and check that the same duration value produces different outcomes.

That is the general principle: where conditions interact, boundary analysis has to be layered on top of the combination technique, not run beside it.