February 2018
Intermediate to advanced
304 pages
7h 11m
English
A function spec describes the operation of a function. It thus contains up to three specs: an “args” spec for the arguments of the function, a “ret” spec describing the return value, and a “fn” spec used to relate the arguments to the return value. Creating function specs unlocks many of the most useful capabilities of the spec library, like instrumentation and generative testing.
The argument spec defines the collection of arguments that you can use to invoke the function being spec’ed. The spec operations we’ve seen so far allowed us to create specs for collections, but we need more power to represent the broad range of variability we see in function arguments—repeated arguments, optional arguments, and other structured ...