3 ms·
"Somebody in the audience was quick to give a counter-example to this absurd claim by using a numeric example ('how do you specify an exponentiation function wi
by tzs 16y ago
"Somebody in the audience was quick to give a counter-example to this absurd claim by using a numeric example ('how do you specify an exponentiation function with a test?')"
How about a test that picks a bunch of random x values, and calls the function to get f(x), then checks to see if those perfectly fit an exponential curve?
- prospero 16y agoThe test function would just be a mirror of the function itself, then. What does that accomplish?
- jar 16y agoA better way to handle this would be to take a set of inputs, run it through the function and then hand-inspect (or use some other tool to check) that the results make sense. Store the inputs and outputs in a CSV file. Now, every time you run the test you should read in this file and compare the results that you get running the function with the results contained in that file (which were already verified to be correct.) This doesn't ensure that the calculations are done correctly, but it does ensure that after future code changes the output remains consistent.