PyCon 2019 in Cleveland, Ohio

Thursday 1:20 p.m.–4:40 p.m. in Room 9

Escape from auto-manual testing with Hypothesis!

Zac Hatfield-Dodds

Description

If you’ve ever written some tests, or discovered that tested code can still have bugs, this tutorial is for you. [Hypothesis](https://hypothesis.readthedocs.io/) lets you write tests that should pass for every case… then finds bugs by generating inputs you wouldn’t have looked for. Even better, you get to save time by writing fewer but more powerful tests, so this process improves your productivity as well as your code! - Learn what property-based testing is, and how it relates to [other kinds of tests](https://www.hillelwayne.com/post/a-bunch-of-tests/)! - Write your first property-based test, with example code and an overview of common tactics! - Describe inputs - use and compose strategies, then define your own or infer them from other code! - Use `hypothesis.stateful` to generate and test whole programs - Get the low-down on Hypothesis: performance tips, debugging tools, and more! You’ll be ready to find real bugs by half way through the tutorial; and by the end you’ll be ready to use Hypothesis in ways we never imagined. There will be dedicated time for Q&A about applying Hypothesis (or PBT ideas) in your domain, testing anything from web apps to big data pipelines to other languages, before you leave to drag the world kicking and screaming into a new and terrifying age of high quality software.

Student Handout

No handouts have been provided yet for this tutorial