The Polyglot's Dilemma: Conformance Testing a Dozen Specs in as Many Languages

2026-08-19

Authors: A. Jesse Jiryu Davis, Jeremy Mikola, Jeff Yemin

ArXiv: 2608.18039v1

PDF: Download PDF

Imagine you build a database that talks to applications through client "driver" libraries. Now imagine you maintain a dozen of those drivers — one for Python, one for Java, one for Go, one for Rust, and so on — and each is written natively in its own language rather than wrapping some shared C core. How do you make sure all twelve behave identically when your users mix and match them across services? That's the problem MongoDB has been wrestling with for eleven years, and this paper is their war story.

The obvious answer — "write the same tests twelve times" — is a nightmare. You'd need every driver team to reimplement every behavioral test whenever a spec changes, and inevitably some team would misread the intent, or skip an edge case, or drift out of sync. Bugs would surface as "the Ruby driver retries on this error but the Node driver doesn't," and users would rightly get furious.

MongoDB's answer is deceptively simple. They write tests once, in YAML. The YAML file describes a scenario abstractly: given this initial state, run these operations, expect these outcomes. Then each driver ships a small test runner — an interpreter that knows how to translate those YAML instructions into real API calls in that language. Add a new test to the shared repo, and every driver picks it up automatically.

The paper walks through what this looks like in practice across the areas MongoDB has to keep consistent: connection handling, retryable writes, transactions, server selection, encryption, load balancing, and more. Each spec gets its own YAML schema. The authors are refreshingly honest about the tradeoffs:

The deeper insight is that when you have N implementations of the same thing, the specification itself should be executable. Prose specs get interpreted differently by each team; a YAML test suite is the interpretation, applied uniformly. It turns "read the spec carefully" into "make this test pass."

This approach isn't unique to MongoDB — the Ethereum consensus community, TLS implementers, and WebAssembly folks all use variants of it — but this is one of the most detailed industry accounts of what it actually costs and what you get for the money, told by the people who lived it for over a decade.

Why it matters: Anyone maintaining multiple implementations of the same protocol or API faces this problem, and MongoDB's eleven-year experience shows that shared, executable, data-driven test suites are a proven path — not a theoretical ideal — to keeping heterogeneous implementations honest.

All newsletters