Bulletproof Python - Property-Based Testing with Hypothesis
Traditional tests are example-based. They require the developer to come up with arbitrary inputs and check a system’s behaviour against explicit outputs. More often than not, developers only think of inputs that are handled correctly by their code, thus leaving bugs hidden. Property-based tests generate the inputs for you and in many cases they’re more likely to find invalid inputs than humans. The difficulty lies in formulating these test cases.
After this workshop you’ll be comfortable with property-based testing using Hypothesis. You’ll have experience requesting appropriate test data from Hypothesis and in writing tests for common and more advanced properties. At work, your co-workers will be impressed by your unbreakable code ;)
Participants are expected to have basic familiarity with unit testing and a testing framework. Provided code examples use pytest.
Please set up the workshop material in advance. To do that, navigate to the Git repository linked in the supporting material section and follow the setup instructions in the README file.
This session took place in track Testing and was classified suitable for intermediate domain / intermediate python by the speaker.