Testing Without Examples (with Examples): A Look at Property-Based Testing
Have you ever heard of an example-based test? Chances are, you've written one without even knowing it! Every time we write a test where the input of the test is known, it's an example-based test.
Let's face it though, example-based tests can be hard to write. "Did I think of every possible edge case?" can be a tough question to answer. Sometimes we just don't know. Property-based tests are a great way to find those edge cases and can even help us fully understand how our code behaves under all conditions. Not just the ones we know about.
In this session, we'll learn all about the benefits (and drawbacks) of property-based testing through a series of examples using C# and FsCheck.