liveBook · Manning

FsCheck

FsCheck is a .NET property-based testing library that generates input values and checks whether specified properties hold for them.

How 2 Manning books explain it

Functional Programming in C#, Second Edition

FsCheck is a .NET property-based testing framework that generates test inputs and runs tests against them.

How it is used
Checks laws such as the applicative law by running parameterized tests over randomly generated inputs.
How deep it goes
Defines property tests and demonstrates applicative-law testing with custom Option generation, while deferring detailed discussion of the underlying laws.
Examples
Tests the applicative law with integers and Option values, including a generator that produces Some or None.
What you can do after
Apply FsCheck to test an applicative law across generated inputs, including custom Option generation.

Read how Functional Programming in C#, Second Edition explains FsCheck →

F# in Action: A Revised Edition of Get Programming with F#

FsCheck is a .NET library for property-based testing that generates input values and checks properties against them.

How it is used
Deploys property-based testing when conventional unit tests provide insufficient confidence in code correctness.
How deep it goes
Explains property-based testing through generated inputs, increasing complexity, and combined input-output properties.
Examples
Uses flipCase, the input "Hello," and progressively varied strings to contrast explicit tests with properties.
What you can do after
Apply it via FsCheck to evaluate correctness across many generated inputs instead of relying on a few hand-selected cases.

Read how F# in Action: A Revised Edition of Get Programming with F# explains FsCheck →

Related concepts

Questions about FsCheck

What is FsCheck?

FsCheck is a .NET property-based testing library that generates input values and checks whether specified properties hold for them.

Which Manning books explain FsCheck?

Functional Programming in C#, Second Edition and F# in Action: A Revised Edition of Get Programming with F#.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.