meta_pixel
Tapesearch Logo
Log in
Talk Python To Me

#67: Property-based Testing with Hypothesis

Talk Python To Me

Michael Kennedy

Technology

4.8635 Ratings

🗓️ 13 July 2016

⏱️ 58 minutes

🧾️ Download transcript

Summary

Let's talk about your unit testing strategy. How do you select the tests you write or do you even write tests? Typically, when you write a test you have to think of what you are testing and the exact set of inputs and outcomes you're looking for. And there are strategies for this. Try to hit the boundary conditions, the most common use-cases, seek out error handling and so on.

Transcript

Click on a timestamp to play from that location

0:00.0

Let's talk about your unit testing strategy. How do you select the test you write or do you even

0:04.6

write tests? Typically, when you write a test, you have to think about what you are testing

0:08.6

and the exact set of inputs and outcomes that you're looking for. And there are strategies for

0:13.5

this. Try to hit the boundary conditions, test the most common use cases, seek out error handling,

0:18.7

things like that. We all do this to varying degrees of success.

0:22.0

But what if we didn't have to do this? What if there is some kind of way to express relationship

0:26.3

between inputs and outputs, but your test could explore the problem space independently on its own?

0:32.2

Well, there is a way, and it's called property-based testing. This week, you'll learn about

0:36.6

hypothesis, the most popular property-based testing. This week, you'll learn about hypothesis, the most

0:38.1

popular property-based testing system for Python, created by David McLever. This is Talk Python to Me,

0:44.3

episode 67, recorded Monday, July 11, 2016.

0:50.0

I'm a developer, developers, developers, develop a first developer in many senses of the word, because I make these applications, but I also use these verbs to make this music.

1:00.0

I constructed line by line, just like when I'm coding another software design.

1:04.6

In both cases, it's about design patterns.

1:07.7

Anyone can get the job done.

1:09.1

It's the execution that matters.

1:12.0

I have many interests.

1:17.3

Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries,

1:19.0

the ecosystem, and the personalities.

1:21.1

This is your host, Michael Kennedy.

1:23.1

Follow me on Twitter where I'm at M. Kennedy.

1:27.0

Keep up with the show and listen to past episodes at TalkPython.fm.

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Michael Kennedy, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Michael Kennedy and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2025.