Writing tests is important for the stability of our projects and our confidence when making changes. One issue that we must all contend with when crafting these tests is whether or not we are properly exercising all of the edge cases. Property based testing is a method that attempts to find all of those edge cases by generating randomized inputs to your functions until a failing combination is found. This approach has been popularized by libraries such as Quickcheck in Haskell, but now Python has an offering in this space in the form of Hypothesis. This week, the creator and maintainer of Hypothesis, David MacIver, joins us to tell us about his work on it and how it works to improve our confidence in the stability of our code.
Do you want to try out some of the tools and applications that you heard about on Podcast.__init__? Do you have a side project that you want to share with the world? Check out Linode at linode.com/podcastinit or use the code podcastinit2020 and get a $20 credit to try out their fast and reliable Linux virtual servers. They’ve got lightning fast networking and SSD servers with plenty of power and storage to run whatever you want to experiment on.
- Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.
- Subscribe on iTunes, Stitcher, TuneIn or RSS
- Follow us on Twitter or Google+
- Give us feedback! Leave a review on iTunes, Tweet to us, send us an email or leave us a message on Google+
- Join our community! Visit discourse.pythonpodcast.com for your opportunity to find out about upcoming guests, suggest questions, and propose show ideas.
- I would like to thank everyone who has donated to the show. Your contributions help us make the show sustainable. For details on how to support the show you can visit our site at pythonpodcast.com
- Linode is sponsoring us this week. Check them out at linode.com/podcastinit and get a $20 credit to try out their fast and reliable Linux virtual servers for your next project
- Open Data Science Conference on May 21-22nd in Boston. 20%
- Your hosts as usual are Tobias Macey and Chris Patti
- Today we are interviewing David MacIver about the Hypothesis project which is an advanced Quickcheck implementation for Python.
Interview with David MacIver
- How did you get introduced to Python? – Chris
- Can you provide some background on what Quickcheck is and what inspired you to write an implementation in Python? – Tobias
- Are there any ways in which Hypothesis improves on the original design of Quickcheck? – Tobias
- Can you walk us through the execution of a simple Hypothesis test to give our listeners a better sense for what Hypothesis does? – Chris
- Have you had trouble getting people to use Hypothesis? How has adoption been? – David
- What does this sort of testing get you that conventional testing doesn’t? – David
- Why do you think this sort of testing hasn’t caught on in the Python world before? – David
- Are there any facilities of the Python language that make your job easier? Are there aspects of the language that make this style of testing more difficult? – Tobias
- What are some of the design challenges that you have been presented with while working on Hypothesis and how did you overcome them? – Tobias
- Given that testing is an important part of the development process for ensuring the reliability and correctness of the system under test, how do you make sure that Hypothesis doesn’t introduce uncertainty into this step? – Tobias
- Given the sophisticated nature of the internals of Hypothesis, do you find it difficult to attract contributors to the project? – Tobias
- A few months ago you went through some public burnout with regards to open source and Hypothesis in particular, but circumstances have brought you back to it with a more focused plan for making it sustainable. Can you provide some background and detail about your experiences and reasoning? – Tobias
- What’s next for Hypothesis? – Chris
Keep In Touch