tomland
tomland copied to clipboard
Implement property-based tests `Codec` laws
Specifically:
- [ ]
Functor - [ ]
Applicative - [ ]
Alternative
I'd like to work on this if it's available, I've been very interested in property testing lately. :)
Hi @Nimor111, that sounds great! I appreciate your enthusiasm 😊 However, note, that this particular issue is a bit challenging. Property-based tests for this issue include generating a random value of the following data type:
data Codec r w c a = Codec
{ codecRead :: r a
, codecWrite :: c -> w a
}
and then a function of type (a -> m b) to test monadic laws for example. This might not be straightforward... There was a recent blog post about how to test such properties with QuickCheck:
- https://blog.poisson.chat/posts/2020-02-24-quickcheck-higherorder.html
But from the package maintainer point of view, I'd love to have something similar based on hedgehog since we use this testing framework for our property-based tests.
If you would like to start with something simpler, but still want to work on property-based tests, I can recommend looking at https://github.com/kowainik/tomland/issues/202. It's much simpler and it's pretty clear how to do it 🙂
@chshersh All right, thanks for the clarifications. :) Since i'm starting out with property testing, something simpler would be better. I'll take the other one then.