Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use qcheck library to test student code #7

Open
Isweet opened this issue Oct 3, 2018 · 0 comments
Open

Use qcheck library to test student code #7

Isweet opened this issue Oct 3, 2018 · 0 comments

Comments

@Isweet
Copy link

Isweet commented Oct 3, 2018

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant