4 ms·
If your code doesn't have tests then you can't refactor because you don't know if you broke something. Getting the right level of tests is important, they shoul
by snovv_crash 10y ago
If your code doesn't have tests then you can't refactor because you don't know if you broke something. Getting the right level of tests is important, they should check the interface and not the implementation, otherwise I agree, you can't refactor anything. But if you test your interfaces the same way that real code would use it then it actually makes you more agile, because it gives you the peace of mind to do major changes.
- dasmoth 10y ago"Tests can make refactoring much easier" is a statement I could easily buy into. "If your code doesn't have tests then you can't refactor" is pure dogma and trivial to falsify (go on, refactor some untested code now!). More likely to introduce bugs? Perhaps. But relying on that absolutist statement about refactoring will alienate me every time.
- snovv_crash 10y agoLet me clarify: you can't refactor without a very awake QA team, because you have no idea what your changes may have broken.
- kalms 10y agoAnd a passing test is a guarantee for a working feature across an entire platform. Every. Time.