Clojurians
# test-check

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

nwjsmith 17:45:40

Has anyone had experience adding 'famous' examples to their test.check runs?

nwjsmith 17:47:03

I think it would be valuable for regression testing, but I suppose that's what clojure.test is for.

hiredman 18:28:38

I think the same thing that would let you do that, also makes it easier to run you test over and over again with a given set of inputs if you do hit a failure, which is useful when you do find a failure

hiredman 18:29:21

the way to do that, I think, is to have your, uh, assertions, as separate functions

hiredman 18:29:41

which you can call from properties or other tests

nwjsmith 18:31:25

That would work

nwjsmith 18:36:02

I'm experimenting with using spec/test.check to do TDD. It's proving more challenging than I thought it would be. Often it's easier to come up with an example than a property/invariant.

gfredericks 21:43:34

writing properties takes practice

gfredericks 21:43:52

"I don't know what properties to write" is a common problem people run into at first

alexmiller 21:45:27

the only hard parts of property testing are the generators and the properties

nwjsmith 21:56:52

I better get practicing then :slightly_smiling_face: Hopefully in a few years, there will be much more guidance on how to do property-based testing. There's so much out there on example-based now.