3 ms·
Static typing combined with functional programming is superior to automated testing, although the three are actually complementary, because automatic, property-
by bad_user 9y ago
Static typing combined with functional programming is superior to automated testing, although the three are actually complementary, because automatic, property-based testing works better if you have type info (such that the library knows what values to generate) and referential transparency, because side effects can be awkward to specify as laws.
So it is not a coincidence that Haskell developers have innovated testing tools and are now sold on QuickCheck, those two working well together ;-)
Being the Scala developer that I am, I love ScalaCheck, but I’ve also used jsverify for JavaScript ... not as good as ScalaCheck or QuickCheck, due to not having static typing and type classes btw, but did the job.
- mishkovski 9y agoStatic typing or functional programming can protect you only from some types of problems. With automated tests you have the flexibility to define the problem you are verifying your code against.
- lkitching 9y agoBy the same token, tests can only verify certain properties of a function. How could you test that a function is free from side-effects? How could you test it never returns null?
- hwayne 9y agoQuickCheck is actually older than the TDD movement!