How do we use assert when testing average behavior of a function with a random element?
• Also, approximately how many test cases are we expected to write for each function?? Is there a max? And most importantly of all, what is the min?? See my answer to the question below. You will just need to use common sense. There are no mins/maxs. You will be marked mostly on the completeness of your test cases — not the number of them. • Obviously it is easier to write test cases for straightforward functions (such as count_nodes and run_one_step) but for more complex functions (such as create_population) involving more in the output of the function, so how many do we write for each?? Try to write test cases that test the most important aspect(s) of the function. For create_population, you might try testing: (1) the appropriate number of individuals is created; and (2) that the fitness value is correct for each program. Correspondingly, you might have two different test cases. However, you probably don’t want to test whether the random programs are constructed appropriately. That