3 ms·
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
by _pius 6y ago
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.
- monkpit 6y agoIt 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.