|
|
|
|
|
by rkrzr
3456 days ago
|
|
> Statically type checked code has all of its code paths effectively tested by the compiler The type checker just ensures that a program is well-typed (i.e. free of type errors). The better the type system the more program properties can be encoded in it and the more errors it can catch (up to the point of proving correctness of your program). But you are right that type checking alone is no substitute for testing. They are orthogonal concepts and both should be employed to ensure that your programs behave correctly. One nice thing of statically typed languages is that they can automatically generate some tests for you, like e.g. the QuickCheck library for Erlang and Haskell. |
|
That means that false positives are the problem for typing systems, while false negatives are the problem for tests. But that's the biggest difference you will find.
One does even replace the other.