← Back to context

Comment by jgalt212

16 hours ago

> The absolute simplest I can think of is just running your functionality on some randomly generated input and seeing that it doesn't crash unexpectedly.

For this use case, we've found it best to just use a fuzzer, and work off the tracebacks.

That being said, we have used hypothesis to test data validation and normalizing code to decent success. We use on a one-off basis, when starting something new or making a big change. We don't run these tests everyday.

Also, I don't like how hypothesis integrates much better with pytest than unittest.

> For this use case, we've found it best to just use a fuzzer, and work off the tracebacks.

Yes, if that was the only property you want to test, a dedicated fuzzer is probably better.

But if you are writing a bunch of property based tests, you can add a basic "this doesn't crash in unexpected ways" property nearly for free.