Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do we use assert when testing average behavior of a function with a random element?

0
Posted

How do we use assert when testing average behavior of a function with a random element?

0

• 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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123