
Break it before a clinic does: how we test DrInCity
A harness per migration, concurrent races, an access matrix, old builds, smoke checks and planted bugs that prove a test can fail.
- Replay every migration from scratch and assert the rules, on every change.
- A race test passes on exactly one winner and positions one to N, not on no error.
- Test every role against every table. A missing policy is a silent hole.
- Plant a bug on purpose. If the test still passes, the test was decoration.
- Write not verified next to anything you have not seen run for real.
DrInCity series · The engineer’s view
Quick answer
Every database change ships with a script that replays the whole migration history and asserts the rules, then concurrent races, a role-by-role access matrix, a check against old app builds and post-deploy smoke checks. We also plant bugs on purpose to prove each test can fail, because a test that cannot fail proves nothing.
The short answer
Every database change ships with a script that replays the whole migration history and asserts the rules. On top of that: concurrent races, a role-by-role access matrix, a check against old app builds and post-deploy smoke checks. And we break the code on purpose, to prove each test can fail. A test that cannot fail proves nothing.
The ladder

- Static checks. Types and lint on every surface. They catch typos and wrong shapes, and nothing else.
- A harness per change. Every migration ships with a script that builds a database from scratch, replays every migration in order, applies the new one, and asserts the rules. Run it twice: a migration that breaks on replay is a migration you cannot trust on a second environment.
- Concurrent races. Dozens of simultaneous writers on one slot, one queue, one key. Not “no error”: exactly one winner, positions one to N, no gaps.
- The access matrix. Every role tries to read and write every table. The rows it must not see stay unseen, and forged writes from an unauthenticated caller are refused. A missing policy is a silent hole, so we test for absence.
- Old app builds. Phones in the field do not update the moment we deploy. The new database must keep working for the previous release, so we test against it.
- Post-deploy smoke checks. Unauthenticated calls are refused. What is deployed matches the repository.
Proving a test can fail
This is the step most teams skip.

After a test passes we plant a bug on purpose: remove a lock, drop a check, flip a comparison. Then we run the test again. If it still passes, the test was decoration, and we rewrite it until the planted bug is caught.
It is slow and unglamorous. It is also the only way to know that a green result means something. A suite of tests that nothing can turn red is a way of feeling safe.
Deploys are part of testing
A database change, the functions that depend on it, the platform config, the web build and the app are separate deploys. Order matters, and so does not forgetting one.

We have been bitten by this: a feature once reached users before the function behind it existed, and the screen reported success while doing nothing. So we compare what is deployed with what is in the repository, and a feature is not shipped until that difference is empty.
What tests don’t prove
Say it out loud, because a clinic will otherwise find it for you.
- Real load. Our harness proves correctness under contention. It does not prove capacity at ten thousand people at once. We publish no capacity number.
- Real providers. SMS delivery and payment gateways behave differently live than in a sandbox. We mark each integration we have not seen run for real.
- Real hands. A reception desk on a bad Monday does things no test script does. That is what the study and the pilot clinic are for, which is why we study first.
We write not verified in the project notes next to anything we have not seen run. When we do see it run, we change the note. That one habit is how a team keeps its own optimism honest.
Questions to ask a vendor
- Show me the test that fails when you remove the lock.
- How do you know the tests can fail?
- What does each role see when it tries to read every table?
- What did your last review find, and what is still open?
- Does your new database still work for last month’s app build?
For the general checklist, see how to test before real users arrive.
The test ladder, the planted-bug practice and the deploy check come from DrInCity’s test harnesses and project notes. We publish no counts of tests, bugs or users, and no capacity or latency figures. The deploy comparison is built; confirm its scheduling before quoting it as continuous.
More by GarunaCDX
What it takes to open the next city for a healthcare platform
We run our own resource hub on the CMS we built for CrawlTheory
One backend, five surfaces: how we structured DrInCity
Let's talk about your build.
Tell us what you are building. A founding engineer replies within one working day with how we would approach it.
