I have a BSON encoder/decoder that I've tested with PropEr, specifically by creating a bunch of bson:document()s and asserting that bson:decode/1 composed with bson:encode/1 is the identity function. See here.
The problem is this: not all bson:documents()s generated purely from type information are valid. I use ?IMPLIES coupled with bson_validate:valid/1 to remove invalid documents, but this chops down the total number of test cases that get run, by about half, in my experience.
How can I:
I note that mm.erl composes smaller functions to generate its test cases, but duplicating this approach in my library would make for relatively heavyweight tests and duplicate contextual information in my library, which I'd like to avoid if possible.