Overview
Property-based testing is a powerful technique to increase trust in the correctness of our code. Being complementary to example-based or parametric testing, this testing technique focuses on finding universal properties that can be asserted for parts of our software, and verifying them on large sets of inputs. In this course we will use KotlinTest, a library that enables PBT in Kotlin.
Prerequisites
- Previous experience with Kotlin.
- Experience writing tests.
- Experience writing tests.
What you'll learn
- The value of property based testing.
- KotlinTest as an implementation of PBT.
- The concept of generators.
- How to write our own generators.
- Arrow generators in KotlinTest.
- How Arrow codebase uses property based testing.
- Writing generators for data types or type class instances.
- Properties. What are they?
- Identifying properties of our software.
- Writing software with PBT in mind.
- Using default generators with properties.
- Using constrained generators with properties.
- Retrying a failed property.
- Real use cases where property based testing applies well.