Guides  /  Rollout and delivery

How do you test a system that was generated instead of hand-written?

Answer

The tests come from the specification that produced the code. Scenarios, evaluation criteria and edge cases each carry the requirement they were derived from, so a failure names the requirement it belongs to.

Akka Specify generates scenarios, evaluation criteria and edge cases as part of the delivered system. Each one measures the system against the requirement that asked for it.

The mechanism

A test read off the implementation confirms the implementation.

A test written by reading the code encodes what the code does. When the code was generated, that test confirms the choices the generator made and says nothing about the requirement.

The specification is the independent statement. A scenario derived from a functional requirement fails when the system does something the requirement did not ask for, whoever or whatever wrote the code.

the requirement the generated code the generated scenario the run passes fails the code or the requirement is changed
What the specification produces

Every test artifact carries the requirement it came from.

ScenariosEnd-to-end paths through the system, derived from the functional requirements.
Evaluation criteriaWhat a good answer means for work with no single right output. Structured output such as SQL and JSON is scored by a deterministic evaluator, and unstructured output is scored by an LLM judge.
Edge casesInputs at the boundary of what a requirement allows, including the failure modes the risk envelope named.
Control harnessesA test harness for each control row in the signed Eval Matrix, run at build time, failing the deploy when a control is unmet.
What a failure tells you

A failing test points at the code or at the requirement.

When a scenario fails, the trace runs back to the requirement that produced it. The change is made in the code when the requirement was right, and in the specification when the requirement was wrong.

Akka Verify captures every interaction into a non-sampled record, so a failing run is replayed against changed code to show whether the outcome moved. The same record is what the evaluation criteria are scored against once the system is live.

Questions

Related questions.

Do generated tests catch a mistake made by the generator?

A test derived from the requirement fails when the system does not meet the requirement, whatever produced the code. A mistake the generator introduced shows as a scenario that does not pass.

How do you test an agent with no single right answer?

Deterministic evaluators score structured output against a rule. An LLM judge scores unstructured output against the criteria written in the specification, and both run offline and online against the interaction log.

What runs before a deployment?

A build-and-deploy gate runs the evaluation suite and fails the deploy when the signed control set is unmet. The gate produces a versioned, hash-chained report.

Do the tests keep working as the system changes?

A change to the specification regenerates the tests that trace to it. A change to the code is checked against the tests that exist, so a change that breaks a requirement is refused before it merges.

What happens to the tests we already have?

Existing tests keep running. Generated scenarios cover the requirements in the specification, and a suite written earlier covers whatever its authors chose to cover.

On Akka. Scenario, evaluation criteria and edge case generation is part of Akka Specify. Deploy gates, LLM-as-judge evaluation and the interaction record are capabilities of Akka Verify.