Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-12 Thread Johan Engelen via Digitalmars-d
On Monday, 5 February 2018 at 19:32:37 UTC, Timothee Cour wrote: just filed https://issues.dlang.org/show_bug.cgi?id=18377: If I may add something semi-relevant to the current discussion, have a look here: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html It is non-trivial to add

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread Walter Bright via Digitalmars-d
On 2/11/2018 3:01 PM, Timothee Cour wrote: It's about `line coverage` vs `branch coverage` (see exact definition in linked article), Ok, I see now, thanks for your patience and the clarification. that difference is very large in practice. Only if one cares about the percentage metric.

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread Timothee Cour via Digitalmars-d
> -cov coverage percentage is the line coverage, not the sequence point > coverage [...] > makes it fuzzy in proportion to how many lines contain multiple sequence > points Based on your comment I'm pretty sure you're still not getting my point, so apologies if I was unclear and let me try to

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread Walter Bright via Digitalmars-d
On 2/11/2018 1:55 PM, Timothee Cour wrote: I think you're missing my main point: it's explained here https://www.ncover.com/support/docs/extras/code-coverage/understanding-branch-coverage but the gist is that line based coverage is over-counting: ``` if(A) // 100 lines of code else // 1

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread Timothee Cour via Digitalmars-d
I think you're missing my main point: it's explained here https://www.ncover.com/support/docs/extras/code-coverage/understanding-branch-coverage but the gist is that line based coverage is over-counting: ``` if(A) // 100 lines of code else // 1 line of code ``` gives a line coverage of ~ 99%

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread Walter Bright via Digitalmars-d
On 2/5/2018 11:32 AM, Timothee Cour wrote: just filed https://issues.dlang.org/show_bug.cgi?id=18377: `dmd -cov -run main.d` shows 100% coverage; this is misleading since a branch is not taken: ``` void main(){ int a; if(false) a+=10; } ``` Consider how -cov works today: 2| x = 3;

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread timotheecour via Digitalmars-d
On Monday, 5 February 2018 at 19:32:37 UTC, Timothee Cour wrote: just filed https://issues.dlang.org/show_bug.cgi?id=18377: @wilzbach It probably makes sense to have a look at how other languages are dealing with this. Seems to be a common problem some links: *