mix test --cover: total is less than the mathematical average

Hi, I’m wondering why the total is less than the mathematical average of the test coverage.
Anyone any idea?
Where do I lose the missing 1.87 percentage?

Percentage Module
100.00% OWL.Individual
100.00% SPARQLQuery.List
100.00% SEAAUtil.Database
100.00% SEAAUtil.QueryGenerator
100.00% SPARQLEndpoint
100.00% SPARQLQuery.Any
100.00% SEAAUtil.Ontology
100.00% RDFLiteral
100.00% SPARQLQuery.RDF.Literal
100.00% SPARQLQuery.RDF.IRI
100.00% OWL.Class
----------- --------------------------
98.13% | Total

Regards, Alain

It’s the “New Math.” :smiley:

The missing 1.87% is so you keep your guards up and continue testing your code.

Just kidding.

If you can provide a way reproduce it, please open up a bug report in the Elixir repo. Thank you!

5 Likes

Thanks for your answer.
I reported the issue. see https://github.com/elixir-lang/elixir/issues/8825

3 Likes

The basic cover tool is (for us) quite inconsistent, a fact that is amplified by the lack of documentation on what metrics the tool uses (iirc, it only counts lines, but I have a few threads here talking about that).

We ended up moving to excoveralls which I strongly recommend if you want something more reliable.

2 Likes

I‘m wondering how excoveralls solved your issues, though. Afaik both tools use erlangs cover module for their core functionality, which is the reason it‘s sometimes choking on things like macros.

1 Like

You are right. I was confused, turns out we moved to excoveralls because the feedback was considerably better. Here is the original discussion, which I recommend to everyone:

1 Like

excoveralls has notion of “stop words” which are ignored or something like that (I haven’t dug into it). So it uses workaround to ignore “generated” code which is not implemented in default coverage tool (at least yet).

1 Like