4 ms·
You may be joking, but this can be a good technique for cases where you have a simple but inefficient solution and a complex optimized solution. Ditto for anyth
by hyperpape 10y ago
You may be joking, but this can be a good technique for cases where you have a simple but inefficient solution and a complex optimized solution. Ditto for anything that has a special case that can be easily answered.
- platz 10y agoAlso known as an 'oracle'
- paulddraper 10y agoHalf-joking. It can be helpful to verify an optimized implementation with a naive one. That's a small minority of testing though. Special casing is effectively traditional testing: input is 1, output is 2.
- nickpsecurity 10y agoI did that for high-assurance systems as an equivalence check to ensure optimizing compiler didn't break things. It's also standard in hardware verification where they equivalence check each step from highest-level form to lowest-level form.