4 ms·
My point is, you shouldn't need one. - "But my code base is so big and complex!" Make it smaller.
by misterman0 8y ago
My point is, you shouldn't need one.
- "But my code base is so big and complex!"
Make it smaller.
- nradov 8y agoSome problems are irreducibly complex. There is no way to make the code smaller or simpler without losing essential functionality or performance.
- jbn 8y agoThis is so true. If the problem domain is so small that you can get away with no tests (only small programs or small teams can indeed get away with it, IMHO), then it cannot be a system of interest. For large systems (i.e. systems so large that any one human cannot fully grasp them), testing is required. Testing does not prove much about the system, it only encodes the assertions of the programmers about how it is meant to work. Testing is merely a harness that constrains the flight domain of the code, it does not guarantee that the code within the flight domain is correct, only that it presents a certain level of certainty about it. Above some system size, the certainty of correctness is merely probabilistic, and automated testing is what gives you assurance. Programming without testing is like driving with a seatbelt: sure it is feasible, but it's insane to do it.
- GorgeRonde 8y agoTests aren't written to simply assert complex things behave as they should. Tests are also used to enforce certain edge cases (e.g. return nil when the the input collection is empty instead of raising an exception), and in this regard allow you to assert stuff your language isn't able to express (because its type system is not as powerful as Haskell for instance). Tests also allow you to avoid stupid mistakes like using a string instead of a symbol as well. And anyway, tests are just a way to durably persist the testing that is always done by a programmer, be it in a REPL or with the few lines of codes at the end of a file used in the writing of code.