08 Bisect

Sometimes, the programming lanugage itself can help you with glass box testing. Often, languages provide support to determine if you've excercised every branch. OCaml's support for this comes in a tool called Bisect. Let's do this with our leap_year function from before.

Now let's write some unit tests. First a helper function:

Now let's run our test suite

(jupyter doesn't like this)

.
Ran: 1 tests in 0.00 seconds.
OK

OK my jupyter notebook doesn't like any of this...

Basically, there's a tool called bisect. It is a coverage tool, tells you which branches you've hit and which you've haven't. Read the textbook chapter 7.4 is the bottom line here.