News for hackers. Stuff that matters.
Re:Is TDD Dead? (2014) by VHRanger on Wednesday August 26, 2020 @12:37PM (#24284150)
Did you ever actually refactor code with a significant test suite written under heavy mocking?

The mocking assumptions generally end up re-creating the behavior creating the ossification. Lots of tests simply mock 3 systems to test that the method calls the 3 mocked systems with the proper API -- in effect testing nothing, while baking in lower level assumptions into tests for people refactoring what actually matters.

You might personally be a wizard at designing code to be beautifully mocked, but I've come across a lot of it and most has a higher cost (in hampering refactoring, reducing readability) than benefit.

Re:Is TDD Dead? (2014) by _pius on Wednesday August 26, 2020 @12:41PM (#24284197)
Did you ever actually refactor code with a significant test suite written under heavy mocking?

I have. The assumptions you make in your code are there whether you test them or not. Better to make them explicit. This is why TDD can be useful as a design tool. Bad designs are incredibly annoying to test. :)

For example if you have to mock 3 other things every time you test a unit, it may be a good sign that you should reconsider your design not delete all your tests.

Re:Is TDD Dead? (2014) by monkpit on Wednesday August 26, 2020 @05:29PM (#24287499)
It sounds like your argument is “software that was designed to be testable is easy to test and refactor”.

I think a lot of the gripes in the thread are coming from folks who are in the situation where it’s too late to (practically) add that feature to the codebase.