4 ms·
When writing in loosely typed languages, some folks aim for 100% line coverage, to make it more feasible to refactor down the line. Which then of course ends up
by anarazel 3y ago
When writing in loosely typed languages, some folks aim for 100% line coverage, to make it more feasible to refactor down the line. Which then of course ends up being a lot of tests for fairly basic stuff that the type system could help you with...
- tubthumper8 3y agoline coverage but also branch coverage. Every safe navigation operator used in "defensive" coding, ex. `foo?.bar` is actually another branch that needs to be covered if that's the metric people are using. All of those tests are unnecessary in a language where the type is known at compile-time.
- anarazel 3y agoMy experience with folks proudly proclaiming "100% coverage" is that it's typically "just" line coverage, even if you're obviously right.
- bjourne 3y agoI think such tests are pretty useless regardless of language. If you work on say a banking system testing whether getBankingStatement() returns something of type string is a waste of time. It just slows you down when you refactor its return value to a BankingStmt instance. While testing what happens in low memory conditions when a user simultaneously deposits and withdraws while another user issues a charge back against them is extremely useful.