2 ms·
Exactly. Sometimes, good design is still the only real way of making sure something works or is secure. It's a bit like using a type system (though that's by a
by brabel 5y ago
Exactly. Sometimes, good design is still the only real way of making sure something works or is secure.
It's a bit like using a type system (though that's by all means not the only way) to ensure invariants.
- necovek 5y agoAgreed: tests only test for discrete "points" of the input space (even with things like hypothesis testing and randomized input testing), and in general, in pure TDD, it is sufficient to test for one each of the class of points (eg. only one negative case to ensure negative part of the code is triggered). But we should not forget we are all working against legacy code bases and libraries outside our control, and sometimes, tests might be the best available tool for achieving something other than their primary purpose, which I'd happily accept as a fun hack.