2 ms·
Seconded. Recently while refactoring I realized I was breaking nearly everything. Most code didn't have tests -- I'm working on an experiment. So, I coded 3-4
by john-tells-all 3y ago
Seconded.
Recently while refactoring I realized I was breaking nearly everything. Most code didn't have tests -- I'm working on an experiment.
So, I coded 3-4 tests of the "run the main program and if it doesn't crash then it passes" style. These tests are silly, but they catch lots of refactoring bugs! And it only took 30 seconds to write the test.
If later I decide the actual _values_ matter, I can add another test, but this "break glass" test is already giving me benefits. I can refactor bravely and see how much stuff goes up in flames. Very useful!