Book a call
Blog

When Green Checks Pass but the Requirement Fails

Passing tests can validate an incomplete outcome. A datasheet-to-page example, how to assert the result where people see it, and a release checklist.

Emmanouil MandrakisPublished: Updated:
Release check panel showing three green checks (schema valid, unit is A, page returns 200) above one unchecked row, "values match datasheet", marked not asserted.

Summary: A green run tells you that the assertions you wrote held on that build. It does not tell you the requirement was met. Tests often check an activity (a field exists, a function ran, a page returned 200) while the requirement describes an outcome someone relies on. Write the requirement as one sentence, assert it where the person sees the result, take expected values from a source you trust, and watch the test fail once on purpose.

What a green check covers

CI reports that specific assertions held for a specific build, environment and input. That is useful evidence, and it is narrower than "the feature works".

The gap opens when assertions describe what the code did instead of what the product must achieve. It widens in AI-assisted work. A model can return output that is well formed and wrong, and a coding agent asked to turn the build green can do it by satisfying the assertions that exist. Whether the requirement holds depends on what those assertions check.

An example: a datasheet becomes a product page

Take a workflow where an admin uploads a product datasheet as a PDF, a language model extracts the specification fields, and the system drafts a product page in two languages. The product owner's requirement: every value and unit on the published page matches the datasheet, in both language versions.

The datasheet contains this table:

ModeMaximum current
Eco2.5 A
Boost5 A

The test suite contains:

test("extraction returns a valid product", async () => {
  const product = await extractProduct(datasheetPdf);
  expect(ProductSchema.safeParse(product).success).toBe(true);
  expect(product.maxCurrent.eco.value).toBeGreaterThan(0);
  expect(product.maxCurrent.boost.unit).toBe("A");
  expect((await draftPage(product)).status).toBe(200);
});

It passes on every build. Then a prompt change makes the extractor read the two rows in the wrong order. The page now shows 5 A for Eco and 2.5 A for Boost. The schema is satisfied, both numbers are positive, the unit is right, and the page renders. An engineer who sizes a power supply from that page picks the wrong rating.

Nothing was wrong with the tests that existed. They asked, "is the extraction well formed?" The requirement asked, "is every value on the page right?"

How to close the gap

1. Write the outcome as one sentence first. Name what must be true, where it is observed and what the source of truth is. Here: the published page, both languages, the datasheet.

2. Assert where the outcome is observed. Render the page and read the values the visitor reads:

test("published page matches the datasheet", async () => {
  const page = await renderPublishedPage(datasheetPdf, "en");
  expect(readCurrentTable(page.html)).toEqual([
    { mode: "Eco", value: "2.5", unit: "A" },
    { mode: "Boost", value: "5", unit: "A" },
  ]);
});

The expected rows are typed by a person reading the PDF. They are never produced by the extractor under test. Repeat the check for the second language, allowing for that language's decimal separator.

3. Make it fail on purpose. Swap the row order in the extractor and confirm this test goes red. Google's discussion of mutation testing describes the general technique: introduce a fault and see whether your tests notice. A check you have never seen fail has not shown that it can.

4. Keep the old test and rename it. extraction returns a valid product becomes extraction output is well formed. It is still useful, and nobody should read it as evidence of correct values.

5. Do not let a model grade itself. A second model pass can flag suspicious output, which is worth having. It is not an oracle. Expected values come from a fixture a human verified against the source.

Stubs have the same blind spot

A stubbed model returns the answer it was written to return, so a test built on it shows only that the pipeline handles that answer. Stubs belong in tests for pipeline logic. Keep at least one check per requirement that runs the real extractor on a real fixture, and run it again whenever the model, the prompt or the parser changes. Choose fixtures with awkward layouts, such as merged cells, units in a column header, or a table split across pages, because those are where extraction drifts.

Report against the requirement

In the release note, write each requirement sentence and put the test or measurement next to it, with the build, model and prompt version it ran against. A sentence with nothing next to it is an open item, not a pass.

A checklist before you call a release verified

  • Each requirement is written as an outcome, with where it is observed and its source of truth.
  • Each requirement maps to a named test or measurement, and the mapping is in the release note.
  • The assertion is made where the user or the next system sees the result.
  • Expected values come from the specification or a human-verified fixture, never from the code under test.
  • Someone has seen each new test fail by breaking the behaviour on purpose.
  • Tests that check structure or activity are named that way.
  • At least one check per requirement uses the real component, and it is rerun when the model, prompt or parser changes.
  • Anything not covered is listed as unverified, with an owner.

FAQ

Are unit tests still useful?

Yes. They locate faults quickly and protect known behaviour. They do not prove an end-to-end requirement on their own, so do not report them as if they do.

Does every requirement need an end-to-end test?

No. Choose the cheapest credible evidence for each risk. A calculation can be covered by reference cases at the component interface. A requirement about what a visitor sees needs evidence from the rendered page.

What if a check depends on a paid or slow model call?

Run it on the changes that can affect the output (model, prompt, parser) and before release, and run the fast stubbed tests on every commit. State in the release note which run the evidence comes from.

Embeddedware's quality engineering work covers test strategy, release validation and test automation. You can read more about it on the quality engineering page.