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!
TTRD
test driven re-design?
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)