3 ms·
There are limited cases where this is possible. Like a pure function that takes a single 32bit number as input. Just go over all the possible inputs.
by planede 4y ago
There are limited cases where this is possible. Like a pure function that takes a single 32bit number as input. Just go over all the possible inputs.
- bluGill 4y agoYou can't as a verify all the outputs though, only that it doesn't crash, which isn't useful for detecting edge cases where the results are wrong but don't crash. And that is a single pure function, if that pure function with a wrong output is then fed into/used by some other function (a non-pure data storage in particular - a large part of what computers are used for is storage of some form, not pure functions) you can read off the end of the buffer or other bad things. Even running through all 4 billion some cases a single 32 bit number can result in your test taking a significant amount of time - enough that you wouldn't want to run it very often. One value of real world tests is often that they can detect that you broke what you thought was a completely unrelated area of code.
- hardware2win 4y agoSeriously? It is pretty easy to imagine function which has limited and low combinations count Enums, bools, etc. >can result in your test taking a significant amount of time - enough that you wouldn't want to run it very often. It is irrelevant in theoretical discussions like this