2 ms·
But the purpose of unit tests is to show that the code under test is correct, i.e. that min() return the smallest input, not just a random value of the same typ
by goto11 4y ago
But the purpose of unit tests is to show that the code under test is correct, i.e. that min() return the smallest input, not just a random value of the same type. Static typing cannot do that, so it is in no way a substitute for unit tests.
Static typing is a useful tool, just not a substitute for any unit tests. The risk of static typing is when it becomes a goal in itself and you start thinking correctness means the program satisfies the type checker.