Want this course?
Building complex generators: matrices
Sometimes the data we need to generate is complex and can't easily be done directly. In that case, we can often do well by generating instructions to build the value. In this lesson, we see how that can be applied to generating random matrices of different sizes.
Strategies for properties: generate the output
Sometimes it is not possible to generate the input directly. And sometimes it is not possible to test the output without reimplementing the function you are testing. In either of these cases, you could always do the opposite of what's normal: generate the OUTPUT and convert it to an input.