5 ms·
Branch coverage is a tiny fraction of total program state coverage.
by jessermeyer 4y ago
Branch coverage is a tiny fraction of total program state coverage.
- psadri 4y agoCould yo I elaborate on this? Do you mean things like exceptions that are not explicitly dealt with in the code?
- btilly 4y agoA simple example is when somewhere in code you set a value that causes you to go into the wrong branch later. You may have tested that every single branch does what it is supposed to, but this "state here causes unexpected behavior there" can still be open.
- masklinn 4y agoBranch coverage just means you’ve taken every branch, not every combination of every branch, for starters. Then there’s branchless boundary conditions e.g. your software might fuck up on overflow, but there’s no branching, at least not in your code. Just things which get incoherent in ways you had not anticipated.
- arinlen 4y ago> Could yo I elaborate on this? Think about it for a second. Imagine you have function(bool foo, bool bar) { if(foo) { //Something } else { //Something else } if(bar) { //Something } else { //Something else } } If you add two unit tests that test foo(true,true) and foo(false, false) you get 100% line and branch coverage, but only hit 50% path coverage.