3 ms·
Thanks. Why is filtering frowned upon? It appears to me the most succinct and elegant description of what I want looking above.
by throw156754228 2y ago
Thanks. Why is filtering frowned upon? It appears to me the most succinct and elegant description of what I want looking above.
- Jtsummers 2y agoIt slows down the testing. All the invalid inputs are generated and then discarded, so it’s much more efficient to come up with a construct that succeeds all the time or at least most of the time. If you ask for an integer but only want odds (as an example), 50% of the generated values will be tossed out with filtering. If you instead take every integer and make them odd (double and add 1, for instance) then all the generated inputs will be usable.