4 ms·
What language do you use? My experience in Scala is that tests can be replaced with types in a number of cases (but not all!) In these cases it is often not wor
by noelwelsh 7y ago
What language do you use? My experience in Scala is that tests can be replaced with types in a number of cases (but not all!) In these cases it is often not worth implementing a test, IMO.
Depending on the code it is possible to construct the types in such a way that an incorrect implementation is very hard. This requires a modern type system and the knowledge to use it effectively. Type systems like in Java and Go are not up the task for the most part.
- lern_too_spel 7y agoIn Scala, you should test that the type system makes the guarantees you expect with compile time errors. Several frameworks provide tooling for this.