What would you do when you are about to add some new features to a large (and dirty) codebase which has virtually *NO* unit-testing code?

后端 未结 2 1589
余生分开走
余生分开走 2021-02-15 02:43

Martin Fowler says that we should do refactoring before adding new features (given that the original program is not well-structured).

So we all want to refactor this

相关标签:
2条回答
  • 2021-02-15 03:34

    Let me recommend the book Working effectively with legacy code by Michael Feathers. It contains a lot of realistic examples and shows good techniques for tackling the legacy code beast.

    0 讨论(0)
  • 2021-02-15 03:37

    My suggestion would be that you touch as little as possible and add what you need. I have found that it is best to leave well enough alone, especially if you are on a tight deadline.

    If you had had unit tests, that would be a different story, but when you change code it can be like touching a spider web. Changing one thing can affect everything else.

    0 讨论(0)
提交回复
热议问题