Rust property-based testing library where a coding agent writes and tunes the generators
open sourceMITfree
Ephyra is an experimental Rust property-based testing library from Datadog Systems Research, built for agentic testing. Given a set of properties, an agent writes a simple test-case generator, Ephyra measures the code coverage it reaches, and the agent then rewrites the generator to reach new regions of the code: a hill-climbing loop that its makers compare to coverage-guided fuzzing, except that it rewrites the generator instead of mutating inputs. Properties are written as #[ephyra::test] functions run by cargo test, failures are shrunk to a counterexample with a replay seed and kept as regressions, and the ephyra CLI runs suites, checks generators and serves a local results page. Its docs are written for coding agents, with a startup prompt to hand one. Its makers report finding bugs in SQLite, PostgreSQL, Lean, FoundationDB and TigerBeetle with it.
Problems it solves
- I want my coding agent to find real bugs in my parser or database with randomized tests, not just write unit tests
- property-based tests with hand-written generators never reach the deep code paths in my Rust project
- a fuzzing-style search for bugs that rewrites the input generator instead of mutating inputs
Features
- Agent writes and optimises test-case generators against code coverage
- Properties as #[ephyra::test] functions run by cargo test
- Shrunk counterexamples with a replay seed
- Failures remembered as regressions and retried first
- ephyra CLI runs suites and serves a local results page
- Docs and a startup prompt written for coding agents
Limitations
- Experimental: its makers say almost all of the code is subject to change1
Alternatives
The same job
These do what Ephyra does.
- Proptest Hypothesis-style property-based testing with shrinking for Rust
- quickcheck (Rust) Property-based testing for Rust with randomly generated inputs and shrinking
