News for hackers. Stuff that matters.
Re:Most Unit Testing Is Waste (2014) [pdf] by floriol on Saturday June 29, 2019 @09:47AM (#20312544)
With TDD, writing unit tests accompanies writing code - which in itself necessities thinking in terms of testability, which is a good thing making the program's components more separable. Regarding the former example, mocking only a single part where it connects to other parts of the system (for example some interface through which it sends warnings to users) is easy and makes the resulting code better (eg, easy to replace the notification manager).
Re:Most Unit Testing Is Waste (2014) [pdf] by seppel on Saturday June 29, 2019 @02:20PM (#20313973)
> With TDD, writing unit tests accompanies writing code - which in itself necessities thinking in terms of testability

I, as a user of your software, only care about the feature, and that the feature works. I don't care about testability, whatever that means. And since I case about features, I think this entails that features have to be tested end to end, and not some unrelated classes ("mocks") that are not even used in the final product.

> is easy and makes the resulting code better (eg, easy to replace the notification manager).

It might or it might not. I have seen too much code which was written way too complex which a lot of unnecessary classes and interfaces, just for the sake of "testability". However, some features did not work every once in a while.

If you have the need for different notification backends, go ahead. Even if you need a notification manager (whatever this is) for this. But don't make code more complicated (sometimes called "test-induced design damage") without need.