Batamye profile picture

Batamye Umar Isabirye

Machine Learning Engineer at Craqt Research Labs

Marshud is a Software Engineer with experience in backend development and building reliable applications. He also has experience working with scalable systems, paying attention to performance, maintainability, and clean code practices.

Lately, he spends his time at Craqt Research Labs engineering solutions for Artificial Intelligence and Machine Learning in manufacturing.

Abstract

Let the Computer Run Your Unit Tests: Property-Based Testing with Hypothesis in Python

Traditional example-based tests are useful, but they often miss subtle bugs because we only test the cases we can imagine. Property-based testing flips this approach and instead of writing individual examples, you define properties (invariants) that your code must always satisfy. The computer then generates hundreds or thousands of smart test inputs, including edge cases and shrinks any failures to the simplest counter-example. In this talk, we’ll explore Hypothesis, Python’s leading library for property-based testing. Starting with simple properties on strings and lists, we’ll move to custom strategies, assumptions, and stateful testing. You’ll watch live demos where Hypothesis finds bugs that traditional tests miss, and see how it works smoothly with pytest. We’ll also cover best practices to keep tests fast and actionable, plus real examples relevant to developers. Whether you’re tired of writing endless example tests or want to dramatically improve code reliability, this session will show you how to let the computer hunt bugs for you. By the end, you’ll be excited to add property-based tests to your own projects right away.

Long Talk Intermediate