17 ms·
Also, I'm not talking about theoretical proof of equivalence, I'm talking about simple test like assert func(params) == rewrite(func)(params) for some rea
by adontz 7y ago
Also, I'm not talking about theoretical proof of equivalence, I'm talking about simple test like
assert func(params) == rewrite(func)(params)
for some reasonable set of func and params. Totally enough to catch problems like this. I'd say [unit-]testing that subtraction operator works is not that hard.
- lixtra 7y agoExcept, that in this case params is a string containing an arbitrary program. It would help the discussion if you read the TFA (edit: more carefully). Rewrite() in this case modified the params program to harden it against Spectre.
- Quekid5 7y agoI think the poster is talking about something along the lines of bisimulation[1]. No need to solve the halting problem for that. [1] https://en.wikipedia.org/wiki/Bisimulation https://en.wikipedia.org/wiki/Bisimulation
- marcinzm 7y agoThat argument applies to pretty much every single unit test ever written. A function running on a single long can take 2^64 possible values. Impossible to test by your logic. Yet they're tested without issues constantly. What you do is put together a long list of sample functions and sample arguments that covers the expected edge cases and then test those for equivalence. Hardly impossible. Just takes time. Not bulletproof but better than nothing.