Re:An External Replication on the Effects of Test-driven Dev...
by user5994461 on Wednesday October 19, 2016 @07:36AM
(#12742881)
> This is why designing the interface in a language with a powerful type system provides the same quoted benefit of TDD.
Yes. TDD came from developers who worked in weak/dynamic typed languages.
It is mandatory to discover errors, that are otherwise discovered instantly for free by compilers in the stronger typed languages.
Strangely, the TDD folks never outline this point.
Re:An External Replication on the Effects of Test-driven Dev...
by paulddraper on Wednesday October 19, 2016 @12:32AM
(#12741079)
I am a big fan of "testing via types".
Unit tests can demonstrate that my code is correct; it can say nothing about how my code is used by others.
In contrast, a type system can extend those protections downstream.
(Yes, yes, unless you go way off the deep end of dependent types, you still need tests. But a powerful type system can systemically prevent a huge number of very common bugs.)
Re:An External Replication on the Effects of Test-driven Dev...
by mercurial on Wednesday October 19, 2016 @12:59AM
(#12741195)
My take it on it is that it can remove most of the boring bugs you would get in a less strongly-typed language and leaves you open to the interesting bugs (eg, logic bugs).
As for dependent types, I'm not sure that even then you would be able to ensure that, say, your cache is correctly invalidated.
In my experience, using a type system to do this requires much less effort and refactoring.