Don't write tests, generate them!
Puneeth Chaganti (~punchagan) |
21
Description:
Property-based testing (or Generative testing) is an interesting way of testing your code by defining properties of your code, and testing that they hold with random input.
QuickCheck in Haskell, where this idea originated, has been ported to several languages and the Hypothesis library provides an implementation of this for Python.
This talk aims to give an introduction to Property based testing in general, and to Hypothesis in particular. The talk will:
- Present a case for using Hypothesis with examples
- Explain properties
- Briefly outline data generation and shrinking
- Give common patterns of coming up with properties
Prerequisites:
The audience should be comfortable reading Object oriented Python code, that uses decorators. Experience in writing unit tests would go a long way to help appreciate the talk.
Content URLs:
Speaker Info:
Puneeth likes to build tools that make lives of people (read as, mostly himself) easier. He has been programming in & teaching Python for the past 7 years and helping build tools for Engineers and Scientists.
He likes write tests to understand and improve the design of his code, and likes to enjoy the confidence given by a significant test coverage.