Hacker News new | past | comments | ask | show | jobs | submit login

That is definitely true and I fully agree with this.

The benefit is basically all the tests that you don't have to change and give you confidence that your refactorings don't break certain things.

But the drawback is all those tests that do need to be rewritten because of the refactoring, and so will slow you down again.

But in the end for this use-case, I think it's a good ROI. Probably the best use-case for TDD.




A brittle test suite during refactoring is usually caused by too much mocking.

Look at the concept of sociable tests.

https://martinfowler.com/bliki/UnitTest.html


Thats a problem of your tests. Go the classicist approach and your test don't fail after a significant refactoring.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: