How to minimize redundancy between unit testing and spec?



I can write a unit test for a function. I can also write an fdef for pre/post-conditions. There seems to be a lot of overlap in what I end up with; should I avoid one or the other? I guess it’s spec that seems like the first one to cut out, since unit tests play so nicely with cider/testing tooling. Do you have a clean workflow that leverages both of these?


Not exactly both of these, but generative testing with test.check and clojure.spec is a killer combo. I’m using it successfully in a very important internal library where bugs must be avoided at all costs, and it’s giving me great confidence that it works fine where tests are green. Much greater than example based testing alone.