Skip to content

What it can't catch

Passing means the Rust matches every case that was recorded, nothing more. What bites rewrites usually lives outside the recording, so know where the edges are:

  • Inputs nobody recorded. The generated cases, the traps, the original's test suite (record --from-tests) and your own --inputs are the ceiling. Add real inputs (production samples, bug reports); the user input that breaks prod is rarely one a generator thinks of.
  • An original that moved on. record saves a fingerprint of the unit's files (recorded-from.json); when the original changes later, diff warns and gate fails until you record again, instead of passing against what the original used to do.
  • Regexes. The regex crate has no lookaround or backreferences, and even a pattern that compiles can treat \w, \b, \d and case-insensitive matching on non-ASCII text differently from JS, Python or Java. Swapping in fancy-regex or rewriting the pattern can pass every recorded case and still differ on a Turkish dotless ı or a zero-width joiner. record adds regex traps (those, the Kelvin sign, long s, Arabic-Indic digits, line separators, final sigma) to every function in a file that uses regexes, but fuzz your real patterns against real text too.
  • What changes between runs. record runs the original twice and sorts out what differed: changed values (times, ids) become wildcards; the same lines in another order (hash maps, concurrency) are compared in any order, so a port still has to produce exactly those lines; a different number of lines becomes ..., which matches anything. record lists each kind: look at every one, since a hash-order or concurrency difference is exactly what can change for real in a port.
  • Floats. Number-to-text formatting differs between languages (1e21, -0, digit counts). The traps include those values, and they must match exactly; --float-tolerance forgives rounding only, never formatting.
  • Anything not in the output. Timing, memory and concurrency under load are not compared. Side effects beyond stdout, stderr, exit codes, written files and HTTP responses are compared only when you record them: app record --effects http,smtp catches outgoing HTTP calls and email, and --db-reset/--db-dump the database's state after each case (Side effects). HTTPS calls through the proxy show only the host, and anything the app reaches some other way (a message queue, signals) is still not compared.
  • Other platforms. A recording proves behavior on the machine that ran it. C whose results depend on type sizes, endianness or the compiler can behave differently on the target; analyze keeps hardware-facing C in C for that reason.
Edit this page on GitHub →