I consider these to be reminders that even with a state-of-the-art testing suite and 100 % branch coverage, bugs still find a way, heh.
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.
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.