3 ms·
Not only will the type-system not substitute these types of tests, but also the reverse: you just don't write tests for types, as they are subsumed by the valu
by mpweiher 12y ago
Not only will the type-system not substitute these types of tests, but also the reverse: you just don't write tests for types, as they are subsumed by the value tests, which is why I object to the canard of "the type system saves you from having to write trivial tests for types".
And yes, a type-system can do certain types of "forall" analyses that are difficult or impossible with tests, but that's a different topic.
- NickPollard 12y agoIt's also more important. Generally with tests, you're less concerned about having some particular examples succeed, than you are with finding if there are possible values that fail.
- pjmlp 12y agoThe fallacy is assuming people write tests. Regardless of what gets preached at agile conferences and such, the reality is that in most enterprise projects, the amount of tests is close to zero.
- the_af 12y ago> you just don't write tests for types, as they are subsumed by the value tests I think this is false.