I agree that type-safe languages give a lot of the advantages of unit test.
I actually don't understand why those who advocate for TDD don't rather advocate you write everything in something like ATS. Every single argument I've seen for TDD would apply even more strongly to doing that.
I tried doing TDD style development for a while, and I found these two things to combine to make it unfeasible"
1) For significant amounts of real-world code writing correct tests is actually harder than writing correct code.
2) In real life you end up discarding much of the code you write.
This means that you end up spending a lot of extra effort to write well tested code that will never end up being run in production.
I find quality integration tests combined with some form of analysis of the more critical parts to be far more productive than TDD.
The equivalent for type-safe would perhaps be type-optional languages like Qi/Shen. I haven't messed around with it much, but it seems to offer rapid prototyping with an enforced type-safe mode that can be turned-on later. Unfortunately its inference engine seems to be inferior to ML or Haskell right now, so transforming code from non-typesafe to typesafe is a bit of a slog (I last tried it a year or two ago, so it may have improved in the meantime).
I actually don't understand why those who advocate for TDD don't rather advocate you write everything in something like ATS. Every single argument I've seen for TDD would apply even more strongly to doing that.
I tried doing TDD style development for a while, and I found these two things to combine to make it unfeasible"
1) For significant amounts of real-world code writing correct tests is actually harder than writing correct code.
2) In real life you end up discarding much of the code you write.
This means that you end up spending a lot of extra effort to write well tested code that will never end up being run in production.
I find quality integration tests combined with some form of analysis of the more critical parts to be far more productive than TDD.
The equivalent for type-safe would perhaps be type-optional languages like Qi/Shen. I haven't messed around with it much, but it seems to offer rapid prototyping with an enforced type-safe mode that can be turned-on later. Unfortunately its inference engine seems to be inferior to ML or Haskell right now, so transforming code from non-typesafe to typesafe is a bit of a slog (I last tried it a year or two ago, so it may have improved in the meantime).