An application that has been running well for years has one drawback: the framework underneath it keeps ageing. The upgrade is on the list and slips by another quarter every time, until the version stops receiving security updates. The delay is understandable. It is a lot of work on processes the organisation depends on, and users get nothing new out of it.
AI changes the pace of that work. But writing code faster helps little if you then have to find out what changed without anyone noticing. So in an upgrade we build the checks first, and only then the new version.
We are doing exactly that right now for a web application that has been running for years and is used by several organisations. Laravel moves up two major versions. The frontend comes along: the component library, the router and the build tools each get a new major version, together with all packages. The upgrade is still in progress. This is how we approach it.
- 0 differing pixels That is the standard. Any difference between old and new is a bug or an intentional change.
- 265 screenshots Per run, in the old and in the new version.
- 4,876 API steps Per run, compared byte for byte.
- 494 frontend tests Newly written. They stay in place after the upgrade.
How the upgrade in progress is set up.
Why the framework has to keep up with PHP
An application like this one is built in layers. At the bottom runs the programming language PHP, on top of that the Laravel framework, and on top of that the application’s own code. Each layer only receives security updates for a limited time. A PHP version gets two years of full support followed by two years of security updates only. For PHP 8.2 that ends on 31 December 2026. A major version of Laravel gets two years of security fixes.
Those layers are tied together. Every Laravel version only runs on a certain range of PHP versions; Laravel 13, for example, requires at least PHP 8.3. If the framework stays behind, at some point PHP can no longer move to a version that still receives updates. A vulnerability in PHP itself then stays open. How quickly you have to act on such a vulnerability became clear in October with PHP2Shell. That makes a framework upgrade security maintenance, even if users notice nothing. Whether PHP itself is still a good foundation is covered in Is PHP still relevant?
We define “the same” before we start
An upgrade is a success when users notice nothing. You can only prove that if you know in advance what you are comparing. That is why this upgrade starts with a phase 0, before we change anything in the application.
- An inventory of production. We map what is actually running: versions, packages, background jobs, scheduled tasks and settings. We only read; we change nothing.
- A replica of production on every workstation. The same PHP version, the same database settings and the same setup of queues, mail and file storage as in production. Several environments run side by side, so the old and the new version are always available at the same time.
- Fixed data and a fixed moment in time. Many screens, emails and exports show a date or time. So in every run both versions start with the same dataset at exactly the same moment. A different time can then never be the cause of a difference.
- An agreement per component. Screens are compared down to the pixel, the API down to the byte, exports cell by cell. An intentional difference goes into a register, with a reason, and only counts once it has been approved.
If anything differs after that, it is caused by the upgrade and not by different data or a different time.
The official upgrade guide has the final say
Every framework publishes an upgrade guide for each major version, such as the Laravel upgrade guide. That guide leads the way for us. We go through it point by point and record what happened to each point: applied, not applicable, or deviated from with a reason. A review agent then checks that the list is complete, and the senior developer signs off.
We do not skip intermediate versions. The build tool, for example, does not jump from version 5 to 8 in one go, but goes via 6 and 7, and at every step we build and compare again. That way any deviation can always be traced to a single version.
The guide also decides what we leave out. We keep a restructuring of the code out of the upgrade, because the official guide advises against it. An upgrade is not a renovation.
Old and new side by side
For the screens, every run captures 265 screenshots, in the old and in the new version. The standard is zero differing pixels. A selection of screens is also captured at seven screen widths, in dark mode and in the states you only see when you hover over a button or move to it with the keyboard. A screenshot is retaken until two consecutive ones are identical, so a half-loaded screen never raises a false alarm.
Schematic example with three panels. Old: a form with two input fields and two buttons, before the upgrade. New: the same form after the upgrade, in which the second input field is slightly narrower, the buttons sit slightly lower and the second button has moved to the right. Difference: whatever is identical is shown faintly. The places where old and new do not match are hatched in red: the end of the second field and the two buttons.
Schematic example. A narrower input field and two shifted buttons: anything that does not match gets flagged.
For everything that happens on the server, every run compares 4,876 steps against both versions, with the same data and at the same moment in time. The responses of the API, the layer through which screens and other systems request data, must match byte for byte. The same goes for everything a user does not see directly, from sent emails to background jobs. Anything that differs by definition every time, such as a random token, is on a short list of exceptions, each with a reason. Nothing else is ignored. Even if session data is stored in a different order, it gets flagged.
In every run the old and the new version receive the same input: the same requests, the same data and the same moment in time. We then compare the outcome of both versions. Any difference is a bug or an intentional change.
What we compare in every run- API responsesStatus, headers and body, byte for byte.
- Cookies and sessionsDown to the order of session data.
- Database changesRow by row in the database.
- Sent emailsEvery email an action sends.
- Jobs in the queueBackground jobs an action queues up.
- Real-time messagesWhat goes out live to other users.
- Files and exportsSpreadsheets down to the cell.
- ScreensDown to the pixel, at seven screen widths.
In every run, old and new receive exactly the same input. So any difference in the outcome is caused by the upgrade.
We also test the switchover itself. Users stay logged in while the code is swapped, and an export that the old version put in the queue is completed by the new one.
So any difference that remains is either a bug, or an intentional change that is in the register.
Two models, one person accountable
Within that framework, AI does most of the work. We work with Claude by Anthropic, using two models in different roles. Claude Opus 5.5 wrote most of the tests up front and then carries out the upgrade step by step: it works through the guide and changes the code. A group of review agents running on Claude Fable 5.2 then checks that step, over a few rounds. A different model does not inherit the assumptions of the one that built it, just as a colleague with fresh eyes reads someone else’s change.
- The official upgrade guide determines what has to happen in each step.
- Claude Opus 5.5 carries out the step: it works through the guide and changes the code.
- An automated comparison checks screens, API and tests.
- Several review agents on Claude Fable 5.2 assess the step, over a few rounds. Without approval, the step goes back to Claude Opus for a new round. After three rounds without approval, the step goes to the senior developer.
- A senior developer does the final check on the crucial parts and approves each step.
- After approval the next step begins, again at the upgrade guide.
This is how every step of the upgrade runs. The review rounds repeat until there is approval, with the senior developer as the final check.
A few hard rules apply:
- A test is never changed to make an upgrade pass. If a test really has to change, that is a separate change that is reviewed separately.
- After three review rounds without approval, the step goes to the senior developer.
- AI merges nothing, deploys nothing and changes nothing in production.
The final check always lies with a senior developer. They do not read every line, but assess the crucial parts themselves and approve each step. That keeps the decision with someone who knows the application, while the writing and reviewing keep moving.
Bugs that were already there
A comparison this strict also records exactly what the old system does, including the places where it deviates from what was intended. Developers always find something during an upgrade, but it has never been this thorough. Every screen, every route and every role is covered, including the parts that are rarely used. That is how we found, for example, that an old build tool quietly dropped a small piece of functionality when it minified the code.
We do not fix those bugs during the upgrade. We record them as part of the starting point and fix them separately, only once old and new are identical. Otherwise you can no longer tell whether a difference comes from the upgrade or from a repair.
What stays after the upgrade
The tests we write for this upgrade stay in place afterwards: hundreds of backend tests and 494 frontend tests. On top of that, after every deployment to the test environment an automated check walks through 28 fixed actions in the application. The next upgrade therefore does not start from scratch, and ongoing development and maintenance become more predictable.
Anyone who has an upgrade carried out can test the approach on one thing: what happens when a test stays red. With us, the test stays and the step goes back.
