News for hackers. Stuff that matters.
Re:I have complicated feelings about TDD by merlincorey on Thursday August 18, 2022 @02:28PM (#32513202)
> But a lot of people cast “unit test” as “test for each method on a class” which is too low-level and coupled to the implementation; if you are writing those sort of UTs then in some sense you are doing gradient descent with a too-small step size. There is no appreciable gradient to move down; adding a new test for a small method doesn’t always get you closer to adding the next meaningful bit of functionality.

In my experience, the best time to do "test for each method on a class" or "test for each function in a module" is when the component in question is a low level component in the system that must be relied upon for correctness by higher level parts of the system.

Similarly, in my experience, it is often a waste of effort and time to do such thorough low level unit testing on higher level components composed of multiple lower level components. In those cases, I find it's much better to write unit tests at the highest level possible (i.e. checking `module.top_level_super_function()` inputs produce expected outputs or side effects)

Re:I have complicated feelings about TDD by remexre on Thursday August 18, 2022 @02:48PM (#32513415)
> is when the component in question is a low level component in the system that must be relied upon for correctness by higher level parts of the system.

And then, property tests are more likely to be possible, and IMO should be preferred!

Re:I have complicated feelings about TDD by ENGNR on Thursday August 18, 2022 @06:05PM (#32515437)
TTRD

test driven re-design?

Re:I have complicated feelings about TDD by knicholes on Thursday August 18, 2022 @08:26PM (#32516410)
TDRD
Re:I have complicated feelings about TDD by dwattttt on Thursday August 18, 2022 @10:51PM (#32517180)
The first acronym cleverly demonstrates the redesign