3 ms·
How much refactoring do you tend to do at the start of a project and do your tests help refactoring?
by postalrat 5y ago
How much refactoring do you tend to do at the start of a project and do your tests help refactoring?
- jmmv 5y agoNot the parent’s author, but I tend to write extensive tests from the very beginning. Sometimes they are indeed annoying while refactoring, but more often than not they are very helpful in ensuring that the whole thing still works. And if the tests are annoying that’s usually a sign that they can be improved.
- rubyist5eva 5y agoPersonally, I don't do much refactoring. If I'm exploring a new idea, I write tests after I've experimented a bit and have a good idea of what I'm going to build - and then write mostly integration tests with very few mocks (usually only calls to external services). I don't refactor until I come back to add features, and yes, the tests help immensly. Red->Green->Keep Moving
- postalrat 5y agoHow much experimenting do you do? You could take that as far as writing it once without tests (experimenting). Then write test for what you created. Then start over and keep the tests.