more useful options | |
PerlMonks |
Re^4: Test Driven Development, for software and for pancakesby Anonymous Monk |
on Jul 25, 2017 at 18:21 UTC ( [id://1196032]=note: print w/replies, xml ) | Need Help?? |
Hi there. Unwittingly, you have provided perhaps the perfect counter-example to TDD. Similar to how one cannot prove non-existence, one also cannot anticipate the unforeseeable. In other words, tests may guard against regressions, but they cannot save you from bugs. In C, bitwise shifts by less than operand width, are allowed. Given 32-bit unsigned int, a shift by 32 invokes undefined behavior. And in particular, on x86 this shift is equivalent to a NOP. print bit_mask(32, 0); But don't feel too bad about it; similar shift-mask bugs have occurred in security-critical contexts before...
In Section
Meditations
|
|