3 ms·
TFA begins by explaining that it's going to explain why why do we need static types although we have TDD. However these are two orthogonal concepts and the fir
by martinced 14y ago
TFA begins by explaining that it's going to explain why why do we need static types although we have TDD.
However these are two orthogonal concepts and the first paragraph of TFA makes no sense.
Also TFA seems to imply that using static types + TDD means we can have programs provably bug-free.
Not so fast there: any bug in production in a TDD+static types is a bug that "escaped" the type system and that didn't get caught by TDD.
And there are many such bugs in production for TDD + static types projects.
I'd say TFA is very poorly trying to make its point (not that the author doesn't have one: but the 'talk' is not nearly anywhere near close the 'code' in TFA).
- jacquesm 14y agoBesides that there are many classes of bugs and that addresses just a few of them.
- pufuwozu 14y agoDid you read the conclusion of TFA? > Analysis is the method for writing code that satisfies our constraints. Neither TDD nor types are the single answer to writing code that does what we want.
- tikhonj 14y agoYou've misread the article. It implies no such thing. The first point is that the type system can prove some functions and properties correct. For these, you don't need tests--no questions there. This doesn't mean you never need tests, but it does mean a type system can replace several kinds of tests completely. If you can actually prove something with the type system, this is strictly better than using tests and tests are unnecessary there. It also doesn't mean the type system will magically stop all bugs. Rather, it means the type system will stop all possible bugs of a particular sort. Which is very valuable. The second half of the article has nothing to do with types. It is an example of where tests are insufficient. A reasonable and practical example, at that. It's completely contradictory to what you claim the article says: the whole section is about something neither types nor tests can catch! It's all best summed up with the final line: > TDD can be useful. Types can be useful. Analysis is necessary. I'm not sure how you can read this as "tests + types produce bug free code" because it clearly says that they're insufficient.