RecordLayer testing

Is there documentation available on the testing approach followed by RecordLayer?

Besides unit and integration tests, does RecordLayer also employ simulation testing in some way? If so, I would be really interested in learning more about it.

I’d say that the JUnit testing is the primary testing suite for Record Layer on its own that we have at the moment, which probably straddles the line between unit and integration tests (as the tests make real database calls).

We don’t use the FDB simulation testing framework, mainly because simulation is very heavily integrated into Flow, and the Record Layer (being in Java) can’t really use it. You could (maybe) conceivably come up with a deterministic thread scheduler and asynchronous task executor, and try and integrate it into Java to get your own deterministic simulator, but that’s not something we’ve done. I also suspect that if, say, one were using a language like Rust with a single-threaded asynchronous task execution library, you might have a better time with recreating something more like simulation, though you’d still have a bit of work to do to bridge simulation across FDB client and server code.

Other than simulation, other ideas we’ve had for better testing have been things like a randomized query generator to test planning and execution correctness and more extensive upgrade/downgrade tests (validating that new code can read older data, and that older code can (within expectations) read newer data). Also, using something like YCSB or a different more standardized database testing framework has come up.

1 Like

Thanks @alloc for the reply!