Testing guides

How to verify AI-generated SQL against business expectations

A report joins orders to shipments and sums revenue.

What catches a plausible query that joins or aggregates the wrong rows?

Check the result against independently calculated rows and totals. A syntactically valid query can silently multiply or discard business events.

Work through the decision

One order split into two shipments is counted twice. A second order with no shipment disappears with an inner join.

Steps and evidence for the reviewer
StepEvidence to keep
Construct counterexamplesUse one split order and one unshipped order.
Compute the oracleWrite down revenue per order before running the query.
Inspect row multiplicityCompare per-order results before comparing the total.

What changes the decision

Keep the seed, expected rows and query together. Aggregate equality on a larger sample can conceal overcounts and undercounts that cancel.

Primary documentation

Your next release starts here

Keep building.
Put testing to work.

Give Cue April your next testing challenge. Let your AI quality lead coordinate the checks, so your team can focus on what comes next.

Create account

Create your account, connect a repository and review your proposed setup before approving a run.