Wayan Jimmy's Brain

The definition of Refactoring

related
Learn go with tests
link
Mocks and tests are still making my life hard

The definition of refactoring is that the code changes but the behaviour stays the same.

If you have decided to do some refactoring in theory you should be able to do make the commit without any test changes. So when writing test ask yourself:

  • Am I testing the behaviour I want, or the implementation details?
  • If I were to refactor this code, would I have to make a lots of changes to the tests?