3 ms·
> Example: if the unit tests represent 50%+ of the code base, one is probably working around dynamic typing Unit tests are checking a lot more than argument ty
by forgotpwtomain 10y ago
> Example: if the unit tests represent 50%+ of the code base, one is probably working around dynamic typing
Unit tests are checking a lot more than argument type.. I have no idea what environment you worked in, but the comment comes across as rather clueless.
- lmm 10y agoUnit tests check a lot more than whether the argument is Int or String, but so do good type systems. I'd say your comment comes across as more clueless.
- MustardTiger 10y agoA huge portion of unit tests are doing exactly that. Many people simply don't realize how many problems are actually type problems. Like null/nil/whatever as the most trivial example. It is more likely that your comment is made out of ignorance than the one you replied to.
- blub 10y agoThe 50% heuristic comes from a story I read once about a company claiming they were able to build a ~200 kloc app in a dynamic-typed language. The secret was their ~200 kloc unit test suite. :) It has nothing to do with argument types per se, just that one must have very high coverage in order to be able to be reasonably sure that their app won't crash after minor code changes. In my current project we can get away with having integration tests cover a lot of ground and only unit test what makes sense thanks to static typing. High coverage is good to have, but should be balanced with test development and maintenance effort.