Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do Factorials in VFP with Recursion
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00335196
Message ID:
00336151
Views:
17
re: "it should average out"

Sure, but it makes sense to be sure, doesn't it?

If you want to get sophisticated with the testing, you can also determine what will be the likely range of numbers. For example, if the numbers being passed to the function are going to be in the range of 25-35 95% of the time, then the results in this range of numbers should weigh more heavily than the results in other ranges of numbers.

But I don't really want to get into a discussion of testing practices in general. I am saying that if you are going to test the speed of one function vs. another, you should use the same set of test parameters with both functions. There is no sense in leaving it to chance.

Take care,
Joe

>Joe,
>
>With large enough sample sets it should average out. If you wanted to be absolutely sure you were using the same set of numbers you can seed the generator with the same large prime number before testing each variant of the code. This will cause the same sequence of random numbers to be generated. But you might want to do a Chi-Square test of the sequence generated by your seed to make sure it produces a good pseudo-random number list.
>
>>Do you believe using random numbers is a good method of testing this?
>>
>>One method may have been using greater numbers and one method using lesser numbers.
>>
>>If you want to randomize the test numbers, stick them in an array or something and run the test with that array. But use the same number set to test the two (or more) methods.
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform