vincent-hugot / qtest

Inline (Unit) Tests for OCaml
GNU General Public License v3.0
67 stars 8 forks source link

corner cases generator #15

Closed vincent-hugot closed 8 years ago

vincent-hugot commented 11 years ago

https://github.com/ocaml-batteries-team/batteries-included/commit/9e26f5b31fa1afbadb30f473b892f51d9f1ae7a0

Gasche said:

Long term, it may be nice to have default generators that exercise corner cases (empty list, 0, negative number, max_int, min_int, sub-normal floats...) with higher probability, instead of uniforms as is mostly the case so far, so that we cover more issues even with reduced test number.

vincent-hugot commented 10 years ago

Given the low number of test cases, rather than using probabilities, I propose going through a fixed list of test "corner cases" before falling back on a standard generator. Of course you need to generate a fresh generator for each test. See recent commit.

edit: and no, the max_int in the corner cases of small_int shouldn't be there. It's just to illustrate the idea, this will be fixed when the default corner generators are defined.

vincent-hugot commented 8 years ago

Present in #19 .