3 ms·
Static typing has nothing to do with testing, or bugs. Static typing is about tooling, autocompletion and being able to follow the code. Using static typing as
by midrus 5y ago
Static typing has nothing to do with testing, or bugs. Static typing is about tooling, autocompletion and being able to follow the code.
Using static typing as a way to reduce the number of tests is just terrible advice in my opinion.
Also, the fact that tests interfere with each other, etc makes me think of just bad tests, not with a problem with the concept of e2e tests itself.
- aranchelk 5y agoIn effect a sufficiently strong static type system greatly reduces the kinds of (mostly undesirable) programs you can compile and in doing so eliminates entire classes of bugs. If you can’t produce those bugs, then you don’t have to test for them. In the dynamic languages I’ve used (even the ones that don’t allow coercion) you can’t ensure the arguments passed to a function at runtime will be the correct type, so you’re usually stuck doing introspection or a try catch/except block to stop an undesirable argument type from messing up your application, and you should probably have tests to verify that. Working in languages with a type system the disallows nulls (nils, nones, etc.) you never ever have to test for null pointer exceptions, that should account for at least a few tests. Moving to dependent types, you can even start to verify the domain logic of your application. I think your argument may hold true for languages like Java, but it’s not applicable for the strong static functional stuff: Haskell, PureScript, Idris, etc.