MicroUnit 1.0 came out this week. It's a PHP testing framework with zero dependencies, and almost all of its code, tests and documentation started as AI output. I chose that on purpose, and I'm saying it up front because I know how that sentence lands in 2026. "Written with AI" reads to a lot of developers like "nobody really checked".
So this post is about the checking. Not "trust me", but the actual setup, with links, so you can decide for yourself.
Why AI at all
MicroUnit started in May 2025 as a side project. By the summer it had a public beta, and then it stalled. Code coverage, parallel runs, a browser UI, framework integrations: building all of that next to a full-time job was too much for one person. Testing it properly was even more.
AI changed the capacity, not the standard. With it, I could test each feature from several sides, how it fails as well as how it passes, which I would never have had the time for on my own.
Who decides, who writes
The split is simple. I decide what MicroUnit does and what it leaves out, how every public API reads in a test, and the architecture. AI implements those decisions, writes the tests for them and writes the docs from the source. Then I review every change.
My review is the one step nobody can verify from the outside. It covers what no automated check can: whether a change is the right one, whether an API reads well, whether a test checks the right thing in the first place. Everything that can be checked automatically is, on every change, so my attention goes where only a person helps.
The harness the AI works in
Every AI session starts with the same rules. CLAUDE.md in the repo holds the code rules (zero dependencies, typed, final readonly by default, no dead code), the commands, the known pitfalls and what "done" means: tests added, suite, canary, lint and PHPStan green, docs updated in the same change.
MicroUnit also answers the agent in a format built for it: one compact JSON object with only the failures, each with the file and line, expected and actual values, plus a warning for every test that passes without asserting anything. The agent's attention goes to what broke, not to a wall of green dots.
Twelve runs for every change
Every push and pull request runs the full suite twelve times: Ubuntu, Windows and macOS, PHP 8.5 and 8.6, once sequentially and once spread over four parallel workers. error_reporting=-1 and OPcache off, so every notice counts and every run compiles from scratch.
The sequential/parallel pair catches a nasty class of bug: tests that quietly depend on what another test left behind. And the matrix earns its keep. Just before the release, it surfaced three real bugs that only appeared on some platforms, including a parallel worker on Windows with PHP 8.5 whose results got lost. Each fix shipped with a test.
MicroUnit is tested with MicroUnit
The suite runs on MicroUnit itself. That's a loop: a change goes in, its own suite runs with the code that just changed, a test turns red, the fix comes with a test that stays forever.
The obvious question: could a broken MicroUnit pass its own tests? It's harder than it sounds, because dozens of tests check that assertions fail when they should, and those are checked by different code (Assert::throws() checking Assert::exact(), for example). Integration tests run the real command line as a separate process against projects with known outcomes.
The one thing a loop can't judge about itself is whether failures get reported at all. That's what the canary is for: a tiny script that loads none of MicroUnit's code, runs four tests with known outcomes (one passes, three fail in different ways) and checks the exit code and the report with plain PHP. If MicroUnit ever stops telling red from green, the canary goes red first.
The check I'd point to first
When a test goes red, an agent can make it green the wrong way: delete the assertion, change the expected value to whatever the code returns now, add a skip. That's the specific risk that comes with AI, so MicroUnit has a check for exactly that. It compares the tests with the previous version and lists removed assertions, changed expected values, new skips and removed tests.
In an agent session it runs after every test run, so the agent hears about it while it's still working. On pull requests, any finding fails the build. And it isn't special tooling for my repo: any project can turn it on with withIntegrityCheck().
The rest of the safety net
- Static analysis: PHPStan at max on all of
src/andbin/, no baseline file. It runs as a PHAR, so it doesn't break the zero-dependency rule. - Coverage floor: about half of
src/is covered, and CI fails below 47%. That number undercounts, honestly: the coverage tool measures the framework it's part of, so the files that start a run (the coverage tool itself, the CLI, the config) are already loaded before measuring begins and show 0% even though they have tests. - Docs lint: the docs are written by AI from the source, so CI checks that every CLI flag, config option, assertion and fluent method appears in them, and that every link leads somewhere. Whether every sentence is right is still my review.
Real projects before a release
My own suite only contains the cases I thought of. So before a release, MicroUnit runs the test suites of six real open-source projects: brick/math, nesbot/carbon, webmozart/assert, league/commonmark, symfony/yaml and monolog/monolog. Their tests are translated with microunit migrate, nobody touches the result by hand, and a project only counts when every test passes and MicroUnit runs exactly as many tests as PHPUnit does. The same runs feed the benchmarks, and everything is reproducible.
Where this leaves me
I don't think AI makes software trustworthy or untrustworthy on its own. What makes it trustworthy is what surrounds it, and whether you can see that. Everything above is public: the pipeline, the canary, the lint, the PHPStan config, the integrity check.
If you find a hole in this setup, I'd genuinely like to hear it.
- The whole process, with links to every check: https://mitarnik04.github.io/MicroUnit/quality-with-ai/
- MicroUnit on GitHub: https://github.com/mitarnik04/MicroUnit
- Docs: https://mitarnik04.github.io/MicroUnit/


