F# - FsCheck for Property-Based Testing
Yesterday I held a one-hour presentation of property-based testing, using the F# library FsCheck at realraum. It more or less covers the introductory documentation of FsCheck, just with fewer details and in a different order.
Although my talk was reasonably well received, questions, feedback and reflection result in some ideas for improvement:
Give a real summary of the main-selling point of property based testing upfront.
Declarative specification, automatic test-data generation and automatic test-case reduction are the important points.
Here I thought it would be better to build the FsCheck explanation step-by-step; but I forgot that for somebody unfamiliar with PBT those key features are important to know whether one wants to listen at all.
Spend more and better time on the very first step:
How to define a property, and how to actually test it.There was one slide with the minimum necessary code for a console program which executes tests on a single property. Understanding this part is a prerequisite to make heads and tails of any following source excerpts. Next time I might spent another minute to explain every single step of it, including where any additional properties go.
What is a property?
“logical property, i.e. function with boolean result” does not cover it. We talk in context of automated software testing, so repeating some main differences between well-known testing frameworks and definition of properties help, as would more examples.
Structure it.
There is a clear distinction between general PBT stuff, and FsCheck basics. Help the brain by making this separation explicit.
Give a heads-up on the structure of the talk.
Tell them what you’ll tell them, tell them, tell them what you’ve told them. For some reason I forgot that.
Provide more context for the code-examples.
No damage done in repeating the first source code slide with changed properties. Not everyone wants to remember the content of one slide for the next 40 minutes.
Unsure: Skip the base tutorial, show the cool stuff, explain basics on the way.
Every time I think about it, and every time I decide against it; I’m afraid nobody would understand a thing of what I’m talking about. However, this time I explicitely got the feedback that this would have been more interesting.
I have to try this once.
Well, besides that, (mostly) everything was fine…