Testing a Riak-baked database layer
tino.breddin at erlang-solutions.com
Mon Apr 4 06:14:07 EDT 2011
After having talked to the Riak team at the Erlang Factory in SF about their recent use of Quickcheck for testing parts of Riak, I wonder whether you guys have some advice on the following issue.
We have a database abstraction layer which uses the Riak Erlang client under the hood. The obvious approach when trying to test that layer with QC is to mock the Riak client. This works fine for standard K/V operations such as get and put. However, trying to create mock implementations for mapreduce queries is a different story and clearly increases the mock's complexity and becomes unfeasible.
So is there a best-practice for testing such a database abstraction layer (with Quickcheck)? If everything fails one would need to spin up a Riak instance for the whole test suite which is still not feasible, but would work.
More information about the riak-users