cmsc330spring18-public
cmsc330spring18-public copied to clipboard
Use `qcheck` library to test student code
Just leaving this here as a suggestion for investigation.
The qcheck is a QuickCheck-like library for OCaml. It can be used to define property-based tests easily.
The documentation gives an example of a test that checks that List.rev is involutive. In addition, the library provides an easy way to convert a qcheck test into an OUnit test.
In addition to abstract algebraic properties, you could also specify operational properties like:
let oracle_elem x l =
elem x l = Oracle.elem x l
which says that the student implementation of elem agrees with Oracle.elem on all inputs (where Oracle.elem is the instructor solution).