Re:Please do not attempt to simplify this code
by AstralStorm on Friday December 28, 2018 @09:14AM
(#18776796)
Write automated proofs? Probably best but tooling is junk - it's rarely supported.
Constraint or property based tests as opposed to value tests? (That depends on how unique.) Usually the only thing that does unique things is a direct mapping, everything else is either an equation or has other preconditions, postconditions and internal or external properties. It also makes the logic more directly visible and refactoring easier presuming tests are reasonably written.
Ensure coverage with a tool to be sure.
I disagree. Unless you are methodical and know what you are doing (like NASA or the authors of Kubernetes), it is hard to create large functions and files by keeping levels of detail consistent and not repeating code.
How do you test a function that has 100 unique outcomes? How do you safely maintain it to ensure it won't break? How do you even know it's working?