Property-based testing is a powerful technique for increasing 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 SwiftCheck, a library that enables PBT in Swift.
- Knowledge of Swift.
- Familiarity with writing tests using XCTest.
- A computer with macOS and Xcode installed.
What you'll learn
- What is Functional Programming
- Swift features for Functional Programming: high-order functions, value types, protocols, optionals, functional combinators.
- Referential Transparency.
- The Substitution Model
- What is a generator?
- Arbitrary and Gen.
- Generators for primitive types and functions.
- Generators for custom types
- What is a property?
- Using default generators with properties.
- Using constrained generators with properties.
- Retrying a failed property.
- Techniques to find good properties for your software.