Table-driven inference means the behavior of your system lives in a table of rules, not in code. Each row says: if these fields have these values, then return this output. A support triage tool might read order status, customer tier and elapsed days, and emit a queue name and a priority. Someone edits a cell, saves, and every future request flows through the new rule.
The test pattern is old and well documented. The Go project describes table-driven tests as entries in a table, each a complete case with inputs and expected results, where the test code loops over every entry and reports what it got and what it wanted the Go wiki. A practitioner guide makes the same point about maintainability: adding a case is appending a row, and every case is checked uniformly a practical guide to table-driven tests. You are applying that pattern to the rules table itself.
Two properties matter. First, exact comparison. Do not assert "contains refund" or "priority is high-ish." Assert the full output object, field by field, so a silent change in a secondary field fails the run. Second, fixed inputs. Store the input as literal data, not as a reference to a database row that may drift.
A minimal case looks like this in YAML:
- name: gold_tier_inside_return_window
input:
order_status: delivered
tier: gold
days_since_delivery: 12
expect:
queue: refunds_priority
priority: 2
template: refund_offer_gold



