Skip to content

ADR: Counting what the tests cover

ADR: Counting what the tests cover

Status
accepted
Date
2026-09-03

276 tests is a number about the tests. This is the number about the code.

In plain words

This page measures how much of the code the tests actually run (code coverage), alongside the number of tests. Counting the code people write and leaving out what the compiler generates, the suite covers 91.5% of lines and 76.7% of branches (3 October 2026), and CI fails if coverage drops below 90 per cent of lines or 75 per cent of branches.

What that is worth: a developer finds out in the build when a change stops testing something, and the organization can show anyone without a login what its tests touch, project by project.

Context

This repository says how many tests it has in several places, and until today that was the only thing it said about them. "276 tests" is compatible with testing one class very thoroughly and everything else not at all, and a reader who has been handed a test count and no coverage figure is entitled to wonder which.

coverlet.collector has been a dependency of the test project since the project existed, and nothing ever ran it. The number cost one flag.

What it is

89.6% of lines, 71.7% of branches
4,745 of 5,294 lines, 622 of 868 branches

TheYard.Data              100.0%   100.0%
TheYard.Domain             98.8%    97.9%
TheYard.Migrations.Sqlite  97.6%   100.0%
TheYard.Infrastructure     93.8%    89.3%
TheYard.Application        93.2%    88.8%
TheYard.Api                78.2%    64.1%

The shape is the interesting part, and it is the shape the architecture predicts. The rules, the entities and the use cases are the parts worth being sure about and they are at 93 to 100 per cent. The host is the lowest, and the host is mostly composition: which adapter gets wired to which port, decided by a setting.

Why the host is at 78 and why that is the right answer

The uncovered part of TheYard.Api is not scattered. It is two classes:

  • AzureSelf, which asks Azure about this container group using the container's own managed identity.
  • TelemetryReader, which queries Application Insights.

Both talk to Azure, and CI has no Azure credentials and is never getting any. That is a standing constraint of this project, not an oversight: a build that needs a cloud credential is a build that cannot run in a fork, and the credential is the thing most worth not having lying around.

Covering them would mean putting a fake HTTP layer underneath and asserting that the fake was called, which tests the fake. What is worth asserting about those two is that they degrade rather than throw when the identity endpoint is not there, and that is tested: the Admin tab's card renders its "not configured" state, and the telemetry endpoint answers with telemetry switched off.

So the honest reading is that the untested lines are the ones whose behaviour against the real service cannot be established from a machine that is not allowed to talk to it, and whose behaviour without the service is tested.

Decision

Collect coverage in CI, publish it where somebody without a login can read it, and hold it to a floor of 85 per cent of lines and 68 per cent of branches.

The floor is a ratchet, not a target. It sits just under where the suites actually are, which makes it a detector for a change that stops testing something without any test failing, and keeps it clear of the number where people start writing tests that execute a line without asserting anything about it. A coverage figure chased for its own sake buys nothing and costs a suite that is slower and harder to read.

Published as annotations, not only as a job summary. A job summary renders for somebody signed in to the repository. Annotations come back from the public API and sit at the top of the run page, which is the difference between a number this project can point at and a number only its author can see. This repository has now paid twice for the lesson that a check nobody can read is not a check (ADR: The exemption that hid a contrast failure, addendum).

A script in the repository rather than a marketplace action, so a reader can see exactly what the number means and so the same command runs locally.

What this is not

It is not a claim that 89.6 per cent is a good number in general. It is the number this suite produces, published so that it can be argued with, and the argument that matters is the per-project table rather than the total: a high average over a system whose rules are untested would be worse than a lower one where they are not.

It also says nothing about the browser suite or the frontend unit tests, which cover a different 44 and 48 things and are not measured here.

Consequences

  • The claim "276 tests" is now accompanied by what they touch.
  • A change that removes coverage fails the build with a sentence naming which floor it went under.
  • One more thing to keep true: the floor has to be raised deliberately if the suites get much better, or it stops detecting anything.

Where it sits

Outside the code, in CI: .github/coverage.py reads the coverage the .NET suites write and holds it to the floor ci.yml names. It cost one flag on the test run and a script; a floor that moves without a measured run behind it would change it.

Files

Addendum, 2026-10-03: generated code left out, and the floor set again

CI had not run since 21 September, because the ship's gate on the build machine runs the suites and CI runs only on pull requests and by hand. Run by hand on 3 October on the commit then live, the coverage step was red: 85.3% of lines and 67.7% of branches against floors of 85 and 68. The fall had come a little at a time and nothing had read it.

Reading the coverage file showed why the number sat so low. 2,102 of the 6,730 branches it counted were code a source generator writes at build time: the regular expressions compiled by [GeneratedRegex] (1,690 branches) and the OpenAPI document's comment readers (412). Nobody here writes or reviews that code, and most of it is paths a regular expression engine keeps for inputs this site never sees. It was holding the number down, and so the floor, which is supposed to notice a change that stops testing the code people write.

So the test run now leaves out anything carrying the GeneratedCode attribute, which those generators put on everything they write, and the floor was set again from a measured run on the same commit: 91.5% of lines and 76.7% of branches, against new floors of 90 and 75. The margin is a point and a half rather than a few tenths because this is the first measurement under the new rule and the CI runner has not yet counted it; the next pass tightens it from the runner's own figure. The floor was raised, not lowered, and the code that holds it is the same script.

Addendum, 2026-10-20: The Shed counts in its own suite

CI on main went red for 1.0.3.186 at 89.5 per cent of lines and 74.5 of branches. The reason was not the day's code alone: since the three .NET web apps became one web app (ADR: One web app for every .NET process), TheYard's host references The Shed's assembly, and coverlet counted it in TheYard's run at 15.2 per cent of its lines, because only the mount reaches it from TheYard's tests. The Shed's own 153 tests cover it and run on the ship gate. So the CI run leaves [TestProject]* out of the number it holds to the floor, beside the document store's adapters and for the same reason: the floor measures what this runner's tests are meant to reach. The same change added tests for the day's untested branches: the plan reader's kind, image and names, the server's other database, the Cosmos DB throughput, the edge's answerer header and the site header itself.

Enforced by

Not machine-checked. Held by review.

Store

The Yard, home

Steven StoutStaff .NET engineerRemote

Production .NET that stays up. Built with AI, measured on every version.

Steven Stout

Hi, I'm Steve. I build the systems that make delivery boring in the best way, then coach people inside them.

  • 200+

    production releases, none took the platform down

    Conway Investment Research, 2019 to 2024. Sole engineer for the first three years on a live financial advisory platform.

    See how
  • 50%

    shorter release cycle

    Storee Construction, 2024 to 2026. Four ASP.NET applications onto one .NET 10 platform on Azure, with a four-person team I hired and mentored.

    See how

01Verified

Steven Stout

A real person, and the work is mine.

  • Identity

    Checked by LinkedIn, not by me.

    LinkedIn verified my government ID.

  • Running system

    You are looking at it.

    Version 1.0.5.273 is live. Nothing ships unless it passes the automated gates first.

That's who I am. Here's how I work.

02Strengths

Ten strengths, each with the proof beside it. The numbers match my resume and LinkedIn, and the live ones are read from this site as you look.

  • 01

    Keeps production alive

    200+ releases on a live financial platform, and none took it down. Sole engineer for the first three years.

    See the Conway work

  • 02

    Simplifies messy systems

    Four ASP.NET applications onto one .NET 10 platform on Azure, and a release cycle 50% shorter.

    See the Storee work

  • 03

    Marries dev and infrastructure

    Blue-green releases at Storee that flipped in about 5 seconds with nobody signed out, and Azure Front Door at two employers.

    See this site's cloud

  • 04

    Designs data that holds up

    White-label clients on one shared database, the isolation built into the data, and no cross-client issues.

    See the Conway work

  • 05

    Keeps AI-written code honest

    15 quality numbers that may only improve: 273 releases in a row with none worse.

    See the quality numbers

  • 06

    Resourceful

    $30,000+ cut from Azure and vendor spend at Conway. This site's Azure bill is public, resource by resource.

    See the bill

  • 07

    Builds people up

    Hired and mentored a four-person team. 13 colleagues recommend me by name.

    Read the recommendations

  • 08

    Takes ideas to production

    This site: designed, built and run solo, with 352 versions measured through one gate.

    How it was built

  • 09

    Writes clearly

    Posts on real engineering problems, in plain words.

    Read the blog

  • 10

    Owns decisions

    153 decision records, each with its tradeoff and the call I made.

    See the decision records

Built with AI. Gated so quality never slides.

Steven Stout’s showcase: a used-vehicle auction on .NET and React, built and run by one engineer, live on Azure, with its decisions written down.

No quality number has gotten worse at any release since 1.0.5.1 on 10 November: 273 releases in a row.

One engineer, an AI agent and a gate that checks 15 quality numbers on every release. 352 versions measured, with every result public, the worst days included.

82 releases in the last 7 days, each through the same gate.

Async methods with no CancellationToken, may only fall

11091.0.3.1391.0.5.2731.0.4.115, the ratchet
Every number, on the Quality page

TheYard, right nowLive

Answering in

unread

02505007501,000

server time at p95, the usual five minutes of the last day.

Azure this month

unread

the bill, by resource, read from Azure. The Admin tab shows every line.

Since the last roll

unread

 

rolled in place by the pipeline, behind one gate.

People who have visited

unread

30 days agotoday

Scanners, my own tools' and my own reads left out.

03Start here

04Where teams are heading

How I see engineering with AI, and the setup on this site that backs it.

AI-augmented teams · Architecture and ownership

AI writes more of the code. Someone still has to own what ships.

Teams are going to be heavily AI-augmented. That moves the senior job toward architecture and technical ownership: deciding what to build in pieces small enough to verify, and owning what ships.

  • Task tracking will get automated too. Judgment stays human: seeing a design fail at scale before it does.
  • On this site the AI's first design held the whole catalogue in memory. I caught it when the App Service plan hit 82 per cent and moved the work to the store.

What the AI wrote, what I decided

07Tech stack

  •    
  •    
  •    

Read from the build, never typed by hand

What TheYard runs on

What we use, where it runs, its AWS twin, the version as built, and the file that proves it.

Cloud patterns, not one vendor: every Azure piece in this stack has a named AWS twin. Mapped, not yet run on AWS.

  • .NET 1114 projects
  • React 19.3TypeScript 7.0
  • Azure9 Bicep files
  • 11GitHub Actions workflows
The whole stack, with the file that proves each line

The last release the gate stopped was 1.0.5.258 on 2 December, at its browser 1 of 2 job.

08How it is built

09How it is run

10Who and why

Next step

11What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn