automerge / automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
http://automerge.org/
MIT License
14.75k stars 467 forks source link

Fuzz testing #299

Open ept opened 3 years ago

ept commented 3 years ago

Even though we already have a solid suite of unit tests with near-complete coverage, fuzz testing with large numbers of pseudorandomly generated inputs would provide further reassurance, especially when switching to the new data structures that have lots of opportunities for subtle bugs.

A while ago I already wrote a minimal CRDT implementation with the intention of providing a test oracle that gives the expected answer. However, I have not yet written the test case generator and the test execution logic.

pvh commented 3 years ago

Do you have a strategy in mind for this, @ept? Seems like a fun little project to experiment with.

ept commented 3 years ago

I had in mind the following approach, which tests only the backend, not the frontend (I think that's good because it allows the same fuzz tests to be run against both JS and wasm backends, and it avoids having to fiddle around with the proxies stuff in the frontend):