The engine's core claims — order-preserving encoding, deterministic log fold, immutable structural sharing, crash-only recovery — are all properties, so the testing strategy is property-first.
Property tests (proptest) — per crate, from M0:
encode(a).cmp(encode(b)) == a.cmp(b) and round-trip for every
value type; datom key composition order.BTreeSet; structural sharing bounds (new segments ≤ f(changed
keys)); segment size invariants.Model-based whole-db tests — a reference implementation of the
database semantics as a plain Vec<Datom> with brute-force query
evaluation. Random schemas, transactions, and queries (including
as-of/since/history views) run against both engines; results must match.
This is the main defense for the query planner: any plan the optimizer
picks must agree with brute force.
Deterministic simulation (corium-sim) — the pure crates take
abstract clock/storage/transport; the simulator drives transactor + peers
Datomic-semantics conformance suite — a corpus of EDN test vectors
(tests/conformance/*.edn): schema + tx-data + query + expected result,
covering Datomic's documented behaviors (upsert rules, component
retraction, as-of edge cases, pull grammar, rule recursion, aggregate
semantics). Written by hand from the Datomic docs, plus spot-verified
against a real Datomic where licensing permits. This corpus is also the
thin-client protocol's conformance kit.
Integration tests — real gRPC over localhost from M4: multi-peer consistency, reconnect/backfill, index-basis adoption, peer server limits.
Benchmarks (criterion) — from M3: encode/decode, segment merge, tx pipeline throughput, query suites on a generated musicbrainz-like dataset; tracked per-commit to catch regressions.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |