Test cases from requirements catch the mistakes that test cases from code cannot, because the author of the tests has never seen the code. In an AI SDLC a QA agent writes the tests from the requirement, its rules and its open questions before any code exists and the coding agent then starts from tests that fail. This post follows one requirement through five ways that tests go wrong when they are written after the code, with the usual approach on the left and the requirements-first approach on the right. The wider method is covered in What is an agentic SDLC?
On 4 June 1996 the first Ariane 5 launcher veered off course and broke up about 40 seconds after its flight sequence began. The inquiry board found that an alignment function in the inertial reference system, which served a purpose only before lift-off, stayed active afterwards and was left out of the simulations and it judged the equipment and system tests insufficiently realistic. The function came from an Ariane 4 requirement and Ariane 5 flew a trajectory with higher horizontal velocity. Tests that follow the behaviour the software already has will pass for as long as the flight resembles the last one and the five failures below begin at that gap between what code does and what a requirement demands.
01One requirement, five failures
Every failure below uses the same requirement from a hypothetical subscription product, shown with the rules and the open question that the QA agent works from. The requirement and the code are illustrative.
In each failure the left column shows tests written after the code by an author who can read it and the right column shows the requirements-first order. The same input goes into both.
02Failure 1: the test repeats the code's off-by-one
A test written after the code tends to copy the code's mistakes. A 2026 study of 11 language models on real Java bugs shows how much. When the models were shown buggy code, they wrote tests that wrongly accepted the bug about eight times as often (3.84% of tests against 0.46%). They also wrote almost three times fewer tests that caught the bug (2.98% against 8.51%).
The input is a customer who buys on 1 March and cancels on 15 March, which is day 14.
The right column needed no cleverness, since the rule already said that day 14 counts.
03Failure 2: the author and the code share one reading of the requirement
When one agent writes the code and then its tests, a misreading of the requirement appears in both and the suite goes green. The same 2026 study found a way out that points in the same direction: asking the model to write down the intended behaviour first and prompting from that description instead of the code raised the share of bug-catching tests from 2.98% to 4.50%.
The input is the open question about sales tax, which finance has not yet answered.
In the usual order one agent holds the code while it writes the tests. In the requirements-first order the QA agent writes against the requirement alone and the coding agent inherits tests that already fail.
04Failure 3: the edge cases come from the code's branches
A test author who reads the code looks for paths to cover, so a case that the code never considered never gets a test. The branch coverage report then reads 100% because the code has no branch for it.
The input is a customer on a 30.00 plan who buys on 1 February, a period of 28 days and cancels on 15 February.
The code divides by a fixed 30 and the rule says to divide by the days in the period. Only the second author was reading the rule.
05Failure 4: a test that has never failed has never shown it can
Tests written after the code usually pass on the first run, because the author checks them against code that already exists and adjusts them until they pass. A test that has never failed has never been shown to catch anything, since it would pass whether the code was right or wrong. Tests written first start red: they fail because the feature does not exist yet and they turn green only when the coding agent makes the right change.
The input is the first run of the suite for the refund requirement.
Run 2 is where the boundary and the divisor from failures 1 and 3 surface and the coding agent fixes both before opening the pull request.
06Failure 5: the tests lose their link to the requirement
When tests come from the code nothing records which requirement each one protects, so a change to the requirement has to be traced by hand. Auditors ask for exactly that link and the same gap leaves old tests in place that still defend the previous rule.
The input is a product owner who widens the refund window from 14 days to 30.
The link runs from each test to the rule it protects, so the change to the window rule lists its three tests and leaves the other three alone.
07Where Orlian fits
Orlian builds this order into the AI SDLC. The QA analyst agent sits in the AI requirements, specs and test cases wing and writes the tests before the code exists, with each test traced to the requirement it protects. The product owner approves the requirements at the planning gate before any code is written and on a live project that gate held because two critical open items had no owner.
In Build the Dev agent starts from the failing tests and its stage policy keeps test writing with a separate agent. When a review comment asked it to add tests it quoted both rules, paused the ticket and asked an engineer. In Verify the AI test automation agents run the traced tests against staging and file every failure to Build with its requirement attached and a person accepts the evidence before release.
Flight 501 is the large version of the refund example: software that did what its code said, tested against the last flight. A test written from a requirement for the flight in hand asks what that flight needs, whatever the code already does.

