

SE Radio 589: Zac Hatfield-Dodds on Property-Based Testing in Python
7 snips Nov 9, 2023
Zac Hatfield-Dodds, Assurance Team Lead at Anthropic, speaks about property-based testing in Python using the Hypothesis library. They explore defining properties for Python functions, implementing test cases, and using advanced features of Hypothesis. They also discuss automating testing, input shrinking, fuzz testing, and introduce Anthropic, an AI research company.
AI Snips
Chapters
Transcript
Episode notes
Property-Based Testing Intro
- Property-based testing offers a different approach to checks and richer tooling for input generation.
- It addresses two testing problems: input data selection and ensuring code correctness.
Autodiff Library Success
- A friend used Hypothesis to create an autodiff library for a machine learning course.
- Hypothesis made it possible to build the library with all the edge cases covered despite time constraints.
Test Suite, Function, and Case
- A test suite encompasses all tests, while a test function is a specific method within the suite.
- A test case is a single input, and multiple test cases can exist within one test function.