caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anton Bachin <antronbachin@gmail.com>
To: "David MENTRÉ" <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: Fri, 12 Feb 2016 03:18:22 -0600	[thread overview]
Message-ID: <1D895000-5F5D-48D3-A667-6FC122C4CB84@gmail.com> (raw)
In-Reply-To: <56BD7F65.1050909@linux-france.org>


> Well I would have marked the "f x". My reasoning is simple, if f is
> executed, it should be green. And f is more important than try regarding
> coverage.

It certainly would be more readable, and we will keep this in mind.
However, I think we would delay addressing this for now, because there are
even more “bad” examples from the point of view of readability, that have
higher priority. For example, the first line of every case is typically not
marked (the pattern is marked instead):

http://rleonid.github.io/bisect_ppx/coverage/file0026.html#L41

So if the same try-expression was on the first line of a case, neither
the try nor the subexpression would end up marked by the current procedure.

While it would be nice to have a solution to this, short of marking every
subexpression, we are not sure what to do. There is some tradeoff between
marking every subexpression and trying to mark only “relevant" branching
points, and so far we have tried to stick to the latter option.

Perhaps it would be good to hear arguments for and against both options.

> Two remarks:
> 
> * If expressions are marked (which I suspected), then the HTML output
> should color at expression granularity level and not line granularity
> level. Therefore you would have only green or red and never orange[1]
> (which would be simpler and clearer);

The output is colored at the expression granularity level. The letters with
the bolder background are the real locations of each mark. Lines are then
colored according to whether they have visited marks, unvisited marks,
neither, or both.

What I think you are suggesting is that each line be subdivided into
subexpression spans, but I don’t think that will work – because an unvisited
expression might have a visited subexpression, for instance.

> * You could do some post-processing to look for such keywords as
> “then”, “else”, and “end” and color them accordingly. It might be more a
> hack than a clean approach, but I think it would make the output more
> readable.

Leonid briefly looked at doing this yesterday, and we will probably look
at it again, but we would expect it to be a bit of a kludge so we would
probably hesitate to implement it. It would make things more intuitively
readable, however, so we are keeping it in mind.


Regards,
Anton


  reply	other threads:[~2016-02-12  9:18 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
2016-02-12  6:44     ` David MENTRÉ
2016-02-12  9:18       ` Anton Bachin [this message]
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=1D895000-5F5D-48D3-A667-6FC122C4CB84@gmail.com \
    --to=antronbachin@gmail.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).