SE-Radio Episode 322: Bill Venners on Property Based Tests

Topics covered
Popular Clips
Episode Highlights
Generator Basics
Generators play a crucial role in property-based testing by producing the necessary data types for testing properties. explains that in languages like Haskell and Scala, generators are based on types, meaning they automatically produce data like doubles or integers based on the function's input type 1. This type-based generation ensures that the data aligns with the expected input, but custom types require custom generators. highlights the importance of matching generator types with target class types to avoid issues like generating invalid data 2.
The type of your generator should match the type of your target class.
---
This approach helps uncover unexpected issues in code, such as improper handling of null values.
Structured Data
Generating structured and context-dependent data presents unique challenges in property-based testing. describes how Scala's for expressions can be used to create generators for complex data types, like a person class with a name and age 3. These generators are concise but require careful composition to ensure all necessary data attributes are covered. However, points out the risk of combinatorial explosion, where not all data variations are tested due to the vastness of possible combinations 4.
You're pretty much probably not going to explore the whole space.
---
Despite these challenges, property-based testing remains a valuable tool for identifying edge cases and ensuring robust code.
Related Episodes

SE Radio 589: Zac Hatfield-Dodds on Property-Based Testing in Python
Answers 383 questions

SE-Radio Episode 283: Alexander Tarlinder on Developer Testing
Answers 383 questions

SE-Radio Episode 256: Jay Fields on Working Effectively with Unit Tests
Answers 383 questions

Episode 474: Paul Butcher on Fuzz Testing
Answers 383 questions

SE-Radio Episode 360: Pete Koomen on A/B Testing
Answers 383 questions

SE-Radio Episode 315: Jeroen Janssens on Tools for Data Science
Answers 383 questions

SE-Radio Episode 262: Software Quality with Bill Curtis
Answers 383 questions
SE Radio 632: Goran Petrovic on Mutation Testing at Google
Answers 383 questions

SE-Radio Episode 357: Adam Barr on Code Quality
Answers 383 questions

SE Radio 572: Gregory Kapfhammer on Flaky Tests
Answers 383 questions

SE-Radio Episode 276: Björn Rabenstein on Site Reliability Engineering
Answers 383 questions

Episode 70: Gerard Meszaros on XUnit Test Patterns
Answers 383 questions
SE-Radio-Episode-249:-Vaughn-Vernon-on-Reactive-Programming-with-the-Actor-Model
Answers 383 questions

SE-Radio Episode 324: Marc Hoffmann on Code Test Coverage Analysis and Tools
Answers 383 questions













