Last week I asked my codebase one question: which of these functions can a user actually reach? Five came back unreachable.
One of them was an entire progression system.
It is a game I am building. You spend research points, cash and four months of in-game calendar on a node that says it gives you curated corpora. The points came out of your account. The corpora never arrived. Not once, in any campaign, since the day I wrote it.
526 tests passed on it. They passed because every test called the granting function directly. The function works. It has always worked. Nothing in the interface has ever called it.
That is the gap I had no check for. A test proves a function does what you expect when you call it. It proves nothing about whether anything calls it.
So I wrote the check
It lists every public method in the simulation layer and greps the interface layer for the name. 46 methods. 21 with no caller. Five that were meant to be things a person does.
Fixed in an afternoon. The five new tests are banned from calling that function directly. They finish the node the way a real day does, then read what the company owns afterwards.
The honest cost
I build with AI assistance and I am open about it, so here is the honest cost. It made me much faster at writing functions that satisfy a description. It did nothing for whether anything calls them. That difference is now on a schedule instead of on my memory.
531 tests. One more script than last week.
What do you use to find code nobody can reach?