4 ms·
Every piece of software defines an input space of all possible inputs for that software. This space is staggeringly, exponentially enormous. However, the space
by jerf 7y ago
Every piece of software defines an input space of all possible inputs for that software. This space is staggeringly, exponentially enormous. However, the space of inputs that are actually given to the software are generally an exponentially small subset of the possible inputs. Making this often very stereotypical and "friendly" space of inputs do mostly sensible things is at least polynomially, if not exponentially, simpler than making the software be entirely correct.
It is both true that software is a streaming pile of bugs, where the vast, vast majority of responses to possible inputs is somehow wrong, yet the vast, vast majority of inputs actually processed by the software are mostly correct (not entirely, but mostly) because they are in the generally polynomial subsets of the exponentially complicated space that the developers made correct... ish.
- sansnomme 7y agoTo expand on this, floating point works for 95% of programs. It is the 5% that needs exact accuracy/precision offered by arbitrary precision libraries. Most programs hardly exhaust the entire range of your typical floating point usage range. For example in a GUI you won't be able to easily tell the difference between 100% and 99.9999999% by eyeballing.
- vonseel 7y agoI think I’ll use your comments as a response next time someone calls me out in a code review or says I deployed a bug. Specifically the polynomial exponentially complicated bits. The look on their faces would be priceless. And they would forever think I’m a jerk... since they wouldn’t get the sarcasm lol.
- hcs 7y agoThis is why model checking and directed fuzzing are so effective! There are situations so stupid only a machine, or reality, could come up with them.