Strange Loop

Practical Property Testing for Services

When we test at the API level, we say "no" to unwanted changes and "yes" to refactoring freedom. At service boundaries, tests express system invariants and expectations that your services will meet. They don't constrain the implementation.

Why don't we do all our testing here? Perhaps because there are so many possible test cases, edge cases and possible combinations of features we could never cover them all.

Property testing solves that. In a property-based test, code generates those test cases, looks for violated expectations, then narrows input to the simplest test case that fails. The Scala compiler uses this kind of testing, and your business software can too.

The most difficult part of property-based testing is conceiving the properties. This workshop will show several techniques for finding and creating properties. In the hands-on practice, we will: * create and compose Generators to produce input data * write and combine Properties to check test results * construct Shrinkers to simplify the failing test cases * tune test output for easier troubleshooting.

Property-based testing is hard -- and that's the best part. Compared to unit tests, property testing pushes us to think more about the overall purpose of our code. Come to this workshop, and get the background you need to push yourself and your tests to a stronger level.

Exercises and demos will be in Scala; the techniques apply in other languages as well.

Jessica Kerr

Jessica Kerr


Jessica Kerr is a functional developer on the JVM, in Scala and Clojure. She speaks at conferences about functional programming, property-based testing, and other ways to make development more joyful. She takes community involvement seriously: you can tell, because she has a tattoo of her twitter handle. Currently she's working on Scala microservice cloud infrastructure at Monsanto, and keeping two gradeschool daughters alive and wacky. Find her work on her blog (Abstractivate), at Pluralsight, and scattered across the internet.