caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anton Bachin <antonbachin@yahoo.com>
To: David MENTRE <dmentre@linux-france.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] [ANN] Bisect_ppx 1.0.0 – Modernized code coverage for OCaml
Date: Wed, 10 Feb 2016 13:27:18 -0600	[thread overview]
Message-ID: <5F24126F-5082-42B8-9FCF-87F924892CA5@yahoo.com> (raw)
In-Reply-To: <56BB694D.1030306@linux-france.org>

Hi David,

Thanks for your comments.

> * l. 107, 'let try_finally x f h =' is not green. The function seems to be called as l. 108 is green. (Same remark for all defined functions)
>   https://rleonid.github.io/bisect_ppx/coverage/file0004.html#L107

This is an oversight on our part. We mark expressions in module-level
let-bindings, and not the let-bindings themselves. The idea is that the
expression is reached if and only if the let-binding is reached. That is
why you see the mark on the next line. However, in case the let binding
has parameters, our marking is wrong. Right now we handle

  let x = (* mark *) 1

correctly and

  let f x = (* mark *) 1

incorrectly, because that desugars to

  let f = (* no mark! *) fun x -> (* mark *) 1

The actual problem is very likely marks occupying the same location. In any
case, I’ve opened an issue for dealing with this:

https://github.com/rleonid/bisect_ppx/issues/81

> * l. 110, 'f x' is not green? 'f' seems to be called if the previous "try" is green.
>   https://rleonid.github.io/bisect_ppx/coverage/file0004.html#L110

The “f x” in try is evaluated if and only if the whole try-expression is
evaluated – unless, perhaps, the *implementation* of exception handling can
cause a memory or stack overflow exception to occur between these two points –
can someone knowledgeable comment? However, assuming my previous statement is
correct, it’s not necessary to have a mark in both places. We chose to put the
mark on “try” because it is technically very slightly easier to do so. However,
we could be convinced to move it to the expression instead.

> * l. 139, '^ ".cmp"' is not green? Once again, this expression seems to executed by your tests.
>   https://rleonid.github.io/bisect_ppx/coverage/file0004.html#L139

Thanks. We are now looking into putting marks on function arguments. It will
require some investigation to do correctly and legibly for all cases (e.g. infix
operators). Not sure why this wasn’t done in original Bisect. If we find a good
reason for *not* doing it, we will document it.

https://github.com/rleonid/bisect_ppx/issues/82

> * l. 168 and l. 169, 'else' is never coloured? For me, it should be green l. 168 and red l. 170.
>   https://rleonid.github.io/bisect_ppx/coverage/file0004.html#L168

To the best of my knowledge, we can’t get the location of the else keyword in an
if-then-else in PPX. That’s why we mark at the start of the subexpressions.

> Overall, I would expect all code lines to be either green, red or yellow, not without colour (except for comments and type and exception definitions).

Bisect_ppx colors expressions and not lines – the line colors just indicate
whether there is a colored expression on each line. So, yes, while many lines in
expressions should be colored, some won’t be – for example, from above, lines
containing only delimiters such as “then”, “else”, and “end”.


We are looking to extend coverage analysis as much as reasonably possible, so
thanks again, and do let us know if you find any other gaps :)


Regards,
Anton


  reply	other threads:[~2016-02-10 19:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 15:33 Anton Bachin
2016-02-10 16:46 ` David MENTRE
2016-02-10 19:27   ` Anton Bachin [this message]
2016-02-12  6:44     ` David MENTRÉ
2016-02-12  9:18       ` Anton Bachin
2016-02-10 19:00 ` Gerd Stolpmann
2016-02-10 19:23   ` Gabriel Scherer
2016-02-10 19:33     ` Anton Bachin
2016-02-10 21:48       ` Gerd Stolpmann
2016-02-10 21:49       ` Alain Frisch
2016-02-11  1:16         ` Anton Bachin
2016-02-11 10:42           ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5F24126F-5082-42B8-9FCF-87F924892CA5@yahoo.com \
    --to=antonbachin@yahoo.com \
    --cc=caml-list@inria.fr \
    --cc=dmentre@linux-france.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).