Skip to content
CodeKruPro

Build a decision table for coupon eligibility

23/32

04 · Design cases and verify stored changes

Recommended first: Test missing, null, empty and wrong-type values

Your goal: Build a decision table for coupon eligibility

Read the lesson, then answer the questions. You do not need to write code.

Start here: sign in, then answer the questions.

Jump to practice

What you will learn

A decision table lists the combinations of conditions and the result of each combination. It shows a missing combination even after every single condition has been tried once.

Your goals

  • Find the one combination that allows the discount.
  • Tell a full table apart from a shorter example list.

Before you start

Read the previous lesson first if you have not already. This course does not require programming.

Practice setup

These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.

Supplied training evidence / contract

Coupon rule DT20-v1: the discount is allowed only when couponActive is true AND subtotalMinor is at least 5000 AND firstOrder is true. Amounts are integer cents. This is a paper rule. No checkout request is required.

Follow these steps

  1. Make columns for active, threshold met, first order, allowed, and reason. Two values for each of three conditions makes eight rows.
  2. Fill all eight rows before you cross any out. Find the row that the rule allows.
  3. With the other conditions true, compare 4999, 5000 and 5001 cents. Decide whether 4999 meets the threshold.
  4. Decide whether deleting a failing row still leaves every combination covered.
  5. Submit Answers. Keep the eight-row table in your notes.

Investigate before concluding

First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.

What to keep as evidence

  • All eight combinations are acknowledged.
  • The allowed row matches the AND rule.
  • A shorter list is not called full coverage.
References for this lesson

Finish this assignment

Answer from the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.

If something goes wrong
  • Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
  • All eight combinations are acknowledged.
  • The allowed row matches the AND rule.
  • A shorter list is not called full coverage.

Change the third condition to active member OR first order, and count the allowed rows again before you test anything.

Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.

Open API reference

Practise and save your evidence

The lesson is public. Sign in to send requests and save progress. You will return to this lesson.

Sign in to practiseCreate an account