Let's say I'm writing a lifespan prediction calculator that takes in ~40 inputs:
sex = ['Male', 'Female']
smoking_status = [True, False]
...
Eventually, there will be trillions of possible test cases that can be exposed using itertools
but these are computed by gradually adjusting each field from left to right:
for test_case in itertools.product(sex, smoking_status):
assert(myfunc(test_case) = trueval(test_case)
Output (not randomized):
['Male', True]
['Male', False]
['Female', True]
['Female', False]
How can I randomly select N=1000
test cases from all possible combinations?
Edit: Constraint #1: As I am concerned over the health and wellbeing of my laptop, I am adding a constraint where I cannot generate a list containing hundreds of trillions of elements and then randomly select a subset of it :)