test-check

nwjsmith 2016-10-24T14:45:40.000081Z

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

nwjsmith 2016-10-24T14:47:03.000082Z

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

2016-10-24T15:28:38.000083Z

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

2016-10-24T15:29:21.000084Z

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

2016-10-24T15:29:41.000085Z

which you can call from properties or other tests

nwjsmith 2016-10-24T15:31:25.000086Z

That would work

nwjsmith 2016-10-24T15:36:02.000087Z

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.

2016-10-24T18:43:34.000088Z

writing properties takes practice

2016-10-24T18:43:52.000089Z

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

alexmiller 2016-10-24T18:45:27.000090Z

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

1
alexmiller 2016-10-24T18:45:47.000091Z

;)

nwjsmith 2016-10-24T18:56:52.000092Z

I better get practicing then 🙂 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.