2 ms·
Run the old tool, run the new tool, compare outputs. If you can't do this, you shouldn't be rewriting anything.
by mnm1 10y ago
Run the old tool, run the new tool, compare outputs. If you can't do this, you shouldn't be rewriting anything.
- JoshTriplett 10y agoIf you don't have a comprehensive set of test inputs, then "compare the outputs" doesn't suffice. (If you do, then by all means, take that approach.)
- majewsky 10y agoI do this a lot (end-to-end tests that just `diff` the results from the current code with the expectation that I previously committed into the repo), and it makes one appreciate how much work it is to make a program's output deterministic. When you look around some of my code, there's a lot of loops over maps/dicts/hashes where, instead of iterating over the map directly, I first gather the keys, sort them, and then iterate over these to ensure that the test is deterministic.
- tofflos 10y agoPlus one for deterministic software. It's an incredibly useful property when you want to test something. Particularly when doing major version upgrades and when replacing entire systems. Unfortunately strict determinism and test coverage often go hand in hand. Either the developer gets it or (s)he doesn't. Fortunately you often do get a least a moderate level of determinism even from the most awful software.