Software Engineering Radio - the podcast for professional software developers

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.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

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.
ANECDOTE

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.
INSIGHT

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.
Get the Snipd Podcast app to discover more snips from this episode
Get the app