> For the complete documentation index, see [llms.txt](https://docs.visdom.virtuslab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.visdom.virtuslab.com/visdom-testing/visdom-testing.md). Agents can also search and read this documentation through its [MCP server](https://docs.visdom.virtuslab.com/~gitbook/mcp).

# Visdom Testing

Validation that holds when the same model wrote the code and the tests.

When an AI writes the code and the tests, who tests the tests?

A green build used to mean two independent things agreed: the implementation and the person who wrote the assertions. Generated code collapses that into one. The tests encode the same assumptions as the code, so they pass for the same reason the code is wrong.

## Four ways the usual signals break

**Circular tests.** The test mirrors the implementation instead of the specification. It cannot fail for the reason you care about.

**Metric inflation.** High line coverage with nothing meaningful asserted. Coverage measures what ran, not what was checked.

**Architecture erosion.** An agent optimises for compiling and passing. The shortest path to that goal routinely cuts through a layer boundary the compiler cannot see.

**API regression.** Models reach for what they saw most in training, which is old. Deprecated clients and retired patterns reappear in new code.

## What the component does about it

It adds layers of validation an agent cannot satisfy by agreeing with itself, each answering a different question:

* **Architecture tests**: does the change respect boundaries the compiler cannot see?
* **Property-based tests**: does the behaviour hold across inputs nobody thought to write down?
* **Mutation tests**: would the tests actually fail if the code were wrong?
* **Contract tests**: do services still fit together, without standing them all up?

None of them is new. What is new is the reason to insist on them: they are the checks that stay honest when the author of the code is also the author of the test.

**Choosing a shape** covers where to put the weight, because the right mix depends on the architecture you actually have.
