3 ms·
Yes, unit tests are code and all code can have bugs, but you're missing the point. Automated tests are a reflection on the code just like code reviews or docum
by dasil003 14y ago
Yes, unit tests are code and all code can have bugs, but you're missing the point. Automated tests are a reflection on the code just like code reviews or documentation or formal specifications. If they are well written (ie. orthogonally structured to the code they are testing and with good readability) then they provide a strong window into the intent of the original developer, and this intent can be continually tested for almost no marginal cost for the lifetime of the code.
Yes there is a maintenance cost, but I find most people's objection to testing is based on poor testing skills. Once you get good at testing with a decent framework, you find that it's often about the same time to write formal tests as it is to do the manual testing which we all know is necessary to have any certainty that code is working.