4 ms·
I read about QuickChck over 10 years ago in Uni, I was just reintroduced to property based testing this week in HelsinkiJS meetup and now this Python implementa
by dirtyaura 12y ago
I read about QuickChck over 10 years ago in Uni, I was just reintroduced to property based testing this week in HelsinkiJS meetup and now this Python implementation hit Hacker News.
Question: most of my backend code is rather dull CRUD and business logic code. Are there good tutorials about randomly generating objects with a few of fields and relationships between them and testing business logic using hypothesis?
- DRMacIver 12y agoHave you seen http://hypothesis.readthedocs.org/en/latest/examples.html#fuzzing-an-http-api http://hypothesis.readthedocs.org/en/latest/examples.html#fu... ? It doesn't test very much - mostly just that the API doesn't produce a 500 error - but it's a decent example of how you can generate structured data with some constraints. http://hypothesis.readthedocs.org/en/latest/examples.html#condorcet-s-paradox http://hypothesis.readthedocs.org/en/latest/examples.html#co... is also a decent example where the data is more uniform but requires a bunch of massaging to satisfy the constraints.