Property-based testing involves generating random test data and checking that code satisfies specific properties for all possible inputs. This improves productivity and test quality by finding more bugs during development. The document discusses property-based testing of common data structures like maps and trees by specifying properties like nodes following certain ordering rules. It also mentions testing actions, models, and using property-based testing frameworks to generate random but reproducible tests based on a seed value. Property-based testing frameworks like QuickCheck, FsCheck, and ScalaCheck are mentioned.
11. §4 – Parent key is greater than left child,
smaller than right child
§5 – No Red Node has a Red child
§6 – Every path from the Root to a Leaf contains
the same number of nodes
§7 – §5 + §6 Tree depth at most 2[log2 (n + 1)]
18. static member ``test chunkBySize`` (sz : int) (vs : int []) =
let sz = wrap sz - 1 vs.Length
let e = vs |> chunkBySize sz
let a = vs |> Stream.ofArray
|> Stream.chunkBySize sz
|> Stream.toArray
e = a
static member ``test collect`` (vs : int [] []) =
let e = vs |> Array.collect id
let a = vs |> Stream.ofArray
|> Stream.collect Stream.ofArray
|> Stream.toArray
e = a