7 ms·
I would like to ask the question what we are actually trying to achieve with both types and with tests. The answer is to, in case of error, find the error as so
by cjfd 7y ago
I would like to ask the question what we are actually trying to achieve with both types and with tests. The answer is to, in case of error, find the error as soon as possible instead of in production when the angry customer calls us. The sooner the error is found the smaller the problem is. If it is found in compilation it says 'you have an error on line 43'. If it is found in automated tested it says 'there is something fishy about functionality such-and-such'. Pushing forward finding the error from compile time to automated test time is a postponement and therefore not an improvement. Also, I really wish I could imagine encountering a production system with a test coverage approaching 100% but I have never been that lucky. In that case your type system is still protecting you but the tests that people failed to write are not doing very much.