A ladder of six test types and a bug marked as caught, on a light background.

    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.

    GC
    GarunaCDX Editorial
    Editorial team
    Nov 22, 2026 4 min read
    Key takeaways
    • 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

    Six rungs of tests, each catching something the one below cannot: static checks, a SQL harness per change, concurrent races, an access matrix by role, old app builds, post-deploy smoke checks.
    Each rung catches something the one below cannot.
    1. Static checks. Types and lint on every surface. They catch typos and wrong shapes, and nothing else.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. 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.

    Four steps: run the test on real code and it passes, plant a bug, run the test again and it must fail, then keep the test.
    Proving a test can fail. A test that cannot fail proves nothing.

    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.

    Five deploy steps in order: database, functions, config, web, app, with a drift check underneath.
    One change, four deploys, one check. The drift check is what catches a skipped step.

    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

    1. Show me the test that fails when you remove the lock.
    2. How do you know the tests can fail?
    3. What does each role see when it tries to read every table?
    4. What did your last review find, and what is still open?
    5. Does your new database still work for last month’s app build?
    Pre-launch test review
    Send us your test plan. We will tell you which rung is missing.
    Book a review

    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.

    Your verdict
    Was this article useful?
    GC
    Written by
    GarunaCDX Editorial
    Editorial team

    Engineers, product and growth folks at GarunaCDX writing about the systems we build for clients.

    View all articles
    Share
    Planning something similar?

    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.

    FAQ

    Frequently asked questions

    A deliberate fault, such as removing a lock or flipping a comparison, added to prove a test notices. If the test still passes, it is not testing what you think.

    Because a migration that works on today's database but fails on a fresh one will fail the next time you build an environment. Replaying proves the whole history holds together.

    Yes. Phones in the field do not update when we deploy, so the new database has to keep working for the previous release.

    No. A big number measures effort, not coverage. We publish the method and what we have not verified.

    The GarunaCDX build log

    Industry insights, once a month

    New case studies, healthcare, marketplace, B2B SaaS and industrial breakdowns, and the engineering notes behind what we ship. One short email a month, no fluff.

    We never share your data — see our Privacy Policy for details.