Designing tests for overlapping inventory rules

Mark Yourself Question

  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.

A retailer classifies inventory records using stock in whole units, supplier lead time in whole days, and a frozen-account flag. Stock is a nonnegative integer or missing; lead time is a positive integer or missing; the flag is always available.


The required policy is:

  • A missing stock or lead-time value produces REVIEW.
  • Otherwise, a frozen account produces HOLD.
  • Otherwise, stock of at most 6 units with lead time of at least 9 days produces EXPEDITE.
  • Otherwise, stock of at most 6 units produces REORDER.
  • All remaining records produce ROUTINE.

A draft algorithm stops at its first matching instruction:

  1. If stock or lead time is missing, assign REVIEW.
  2. If the account is frozen, assign HOLD.
  3. If stock is at most 6 units, assign REORDER.
  4. If stock is at most 6 units and lead time is at least 9 days, assign EXPEDITE.
  5. Assign ROUTINE.

A) Explain the defect, give a concrete counterexample, and correct the rule order.


B) Design a compact test table with expected outcomes. Cover every output, values immediately below, at, and above both numerical thresholds, each missing input, and precedence between missing information, frozen accounts, and ordinary inventory rules. Explain what passing these tests establishes.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Data Algorithms Questions: