question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing branch coverage for DFA.random_word()

See original GitHub issue

@Tagl I am getting pretty close to releasing v7 (hooray!). However, I noticed that there was a slight drop in code coverage with the introduction of DFA.random_word(). Since you implemented that method, I wanted to ask for your help in covering that additional case.

From what I can tell, the outer loop never runs for more than one iteration (either that, or it never completes without a break). In your tests, you seem to be testing high-enough values of k, so I suspect the real gap may be not testing random_word() with a partial DFA (i.e. allow_partial=True). But I could certainly be wrong. 😅

I would appreciate any help you can offer. Screenshots are provided below.

HTML coverage report (locally): Screenshot 2022-11-10 at 11 40 29 AM

Coveralls Report (link) Screenshot 2022-11-10 at 11 39 11 AM

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
caleb531commented, Nov 11, 2022

@Tagl That totally makes sense. And it wouldn’t be the first time there’s been an unreachable branch in the codebase (i.e. search for # pragma: no branch 😅).

In that case, it should be safe to ignore the coverage by adding a # pragma: no branch, meaning I can move forward with publishing v7 today! 🎉

0reactions
caleb531commented, Nov 15, 2022

Closing this issue since I resolved it shortly before releasing v7 recently. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to report missing branch coverage | Verification Academy
Branch coverage is 98.8% -- couldn't understand which branches are missed. Someone help, whether am I missing something here or how can see ......
Read more >
Write Tests for all your Missed Branches | by Nikit Bhandari
Branch coverage is a metric that indicates whether all branches in a codebase are exercised by tests. A “branch” is one of the...
Read more >
Missing branch coverage while using Sealed Classes #1219
Using Sealed Classes within a when is exhaustive. So the branch coverage should be 100% in given example. Actual behaviour. Jacoco reports the...
Read more >
Code coverage missing a branch if a function takes reference ...
In my (lcov) code coverage with google unit tests, it is saying missing a branch with TestA() function, and symbols list have a ......
Read more >
Branch coverage measurement — Coverage.py 6.4.4 ...
Each line in the file is an execution opportunity, as is each branch destination. The HTML report gives information about which lines had...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found