Hacker News new | ask | show | jobs
by carver 2207 days ago
> Hypothesis is pretty smart to find edge cases that you usually don't think of.

This is worth reemphasizing.

For certain kinds of hard problems, I've found it really valuable for building confidence in an implementation.

If you happen to have a reference implementation, with a small surface API, it can be a very fast way to write tests: tell hypothesis to input anything it wants and validate that both libraries produce the same result. It's not magic, you will probably still have to give hints about how to build interesting inputs, but still a very quick way to get a lot of coverage. (Also be sure to crank up the number of examples to build more confidence, 100 is often not enough to really explore an input space).