Remix.run Logo
shahindohan 3 days ago

The only issue I have with writing tests before refactoring is that sometimes it can take a really long time to write those tests and cover all the cases, not to mention needing to sometimes refactor to make the code even testable.

I've made huge successful refactors using nothing but carefulness and manual testing, maybe just a very little bit of unit testing :)

jt2190 3 days ago | parent [-]

I like to make the distinction that the absence of automated tests is not the absence of tests altogether, and that the time it takes to get an automated test set up might be longer than doing the test manually. This is especially important to be aware of if the tests will be temporary because the code is about to be changed.

Of course the goal is to reach an end state with automated tests, but insisting on 100% automated tests up-front can actually prevent the refactoring from even starting.