News for hackers. Stuff that matters.
Re:Is TDD Dead? (2014) by tel on Wednesday August 26, 2020 @09:03AM (#24282028)
Frankly good type systems displaced TDD for me. They do a better job getting at the goals of TDD than TDD does. Types in good systems (OCaml, Rust, Typescript, Scala, Haskell, others) are 100% laser focused on depicting good public interfaces and laying out their behavior.

Sometimes you need a test or two to really nail down this behavior. That'll give you a TDD-like flair. But it's not the same because you've already invested so much productive thinking time into the interface driven purely by the types. At that point, TDD is good hygiene, but not a transformative practice.

Re:Is TDD Dead? (2014) by terrortrain on Wednesday August 26, 2020 @10:29AM (#24282785)
For js->ts, this is right on the money.

When I started unit tests way back when, half the tests were just checking what happens if you give it strange arguments.TS now does that job for me.

Another thing that has cut down on the number of tests is switching to pure functions for most things. And trying to isolate side effects as much as possible, so you really don't need to write to many tests around it. If the function only has one or two lines, typically types are enough to catch potential issues.

Re:Is TDD Dead? (2014) by mattmanser on Wednesday August 26, 2020 @06:39PM (#24288123)
It's one of the things that really frustrates me with the ASP.net team. They're obsessed with unit testing, have made really stupid decisions that means tons of stuff now gets injected instead of just passed, all in the name of unit testing.

But C# is a typed language and generally doesn't need reams of unit tests, so all it does is make the code unnecessarily complicated.

My big bugbear was when they idiotically made the config injected, of all the things that should be super simple to use, and definitely not injected, it's config. It only changes between environments.

Re:Is TDD Dead? (2014) by jacques_chester on Wednesday August 26, 2020 @11:47AM (#24283520)
> Frankly good type systems displaced TDD for me. They do a better job getting at the goals of TDD than TDD does.

I think it's a false dichotomy. Where you have types, use types. Where you don't, use tests. Either way, get a tool to guide you to the answer and then check the invariant during future changes.

In fact TDD made me more aware of and appreciative of types. Writing types-by-hand is very tedious and wasteful.

Re:Is TDD Dead? (2014) by terrortrain on Saturday August 29, 2020 @04:51PM (#24319339)
Writing types by hand is not any less wasteful than writing documentation.
Re:Is TDD Dead? (2014) by andrewedstrom on Wednesday August 26, 2020 @02:18PM (#24285469)
There is a great talk by Gary Bernhardt exploring this exact view. It shows how types and and tests actually do not solve the same problems and are not interchangeable.

https://www.destroyallsoftware.com/talks/ideology

Re:Is TDD Dead? (2014) by blandflakes on Wednesday August 26, 2020 @03:56PM (#24286569)
I didn't RTFA from Gary Bernhardt, but this has been my experience. I love types, but it's not like good types replace good tests. They just eliminate some states from the search space.