4 ms·
How did you know that the code still worked after you refactored it? At the very least, the tests are a list of things the code should do.
by RandallBrown 8y ago
How did you know that the code still worked after you refactored it?
At the very least, the tests are a list of things the code should do.
- jazoom 8y agoTry it and see if it works?
- posixplz 8y agoWhat could possibly go wrong? If a refactor is sufficiently canonical that "try it" is acceptable, and you have little/no edge cases, then it should be trivial to write a good test for the same code. After all, what does a test do, besides "try it"?