Test code is total: we require it to always terminate or it's a failure! It also typically has 100% line and branch coverage.
I feel way less nervous about refactoring tests, you can always just run them.
I find test coverage a useful thing to track, but I can't find a good metric.
"Coverage decreased by 10%" sounds bad. If you're deleting pointless code that has tests, it's good!
Perhaps total untested lines of code is better?
I used to think gradual type systems (mypy, flow, typed racket) were the sweet spot. They're super-powered linters that help with refactoring, but you can run the code at any point.
In a statically typed PL, you need the whole codebase to be well typed before you can run tests.
Wilfred Hughes
Shared words: refactoring, Test, code, run
Score: 82.5
I find mypy very helpful for refactoring Python codebases. It sometimes finds bugs before I run my refactored code, but a large percentage of the time it's just helpfully pointing out where I have the wrong number of args.
Pareto principle strikes again.
Wilfred Hughes
Shared words: refactoring, code, just, run
Score: 80