News for hackers. Stuff that matters.
Re:TDD did not live up to expectations by eropple on Thursday June 29, 2017 @12:22PM (#14664494)
> Testing first forces you to think about your desired outcomes and design your implementation towards them. If you think clearly about your problem, invariants, and APIs then you will guide yourself towards a decent system.

The way I put it: "if I don't know the domain and range of my function, I shouldn't be writing code yet, I should be investigating the problem."

TDD is for unit tests, and unit tests best test functional, stateless code--the functional, central logic of your application is what you should be specifying and writing unit tests for, not all the imperative stuff wrapping it for IO and failure catching and the like (Gary Bernhardt[1] calls it scar tissue).

[1] - https://www.destroyallsoftware.com/talks/boundaries

Re:TDD did not live up to expectations by Retra on Thursday June 29, 2017 @11:39PM (#14668495)
If you don't know the domain/range of your function, and you are forced to write tests in advance, then you will end up specifying a domain/range. The worry here is that you pick a domain/range that is really inefficient, and you write 'bad' code to support it, and you can't refactor it out without more overhead later.

Now, this is a minor issue. It's probably more worth it to build inefficient interfaces now and try to fix them later than to never build anything because you don't know what the optimal design is. I can't say if TTD gives a real advantage there, but when designing-while-coding-with-no-tests, you end up playing with the interfaces, changing them regularly, and learning something about why they are the way they are. Which is possibly a better process when you don't have any relevant design experience? I really don't know...

Re:TDD did not live up to expectations by tieTYT on Thursday June 29, 2017 @05:43PM (#14667117)
> TDD is for unit tests

Never heard anyone say this. Kent Beck has said the opposite on podcasts.

Re:TDD did not live up to expectations by eropple on Thursday June 29, 2017 @06:08PM (#14667251)
I think it probably depends on what your definition of "unit" is. As I stress functional units that encapsulate logic and data model but don't permute state, my units are probably significantly larger (and simpler) than those of people writing more imperative/traditional-OO units (where something under TDD may encapsulate many units due to mounting complexity/complication and so require further decomposition).