unit testing - How should I Test a Genetic Algorithm -


I have created quite a few genetic algorithms; They work (they quickly find a suitable solution) but now I have come to know what is a way of writing TDD method one (which relies heavily on random numbers)?

To more generally put questions, how do you test a non-deterministic method / function. Here's what I thought:

  1. Use a specific seed. If I make a mistake in code in the first place but help in finding bugs during refactoring, then I do not get help.

  2. Use the known list of numbers as above, but I could follow the code by hand (which would be very tedious).

  3. Use a constant number at least I know what to expect. It would be good to ensure that a dice always reads 6 when randomflot (0,1) always returns 1.

  4. Try to exclude the maximum non-determinative code as possible, GA, which seems silly because its purpose is root.

Very good books links will also be appreciated on the test.

I think the only way to test continuous logic is Correct input , ... or each run treat as a single automaton whose state has been tested before and after it, the overall ethical system On the basis of assessable running values, it is converted into testable components.

Variations in iterations / inheritance of inheritance / trait, test those values ​​on the boundaries of each walk and test global production of all iterations based on known input / output from successful moving sub-test ...

Because the algorithm is recurring, you can use induction in your test to make sure that it repeats it 1, repeat n + 1 Works for the Ion, it is to prove that the odds of the input range / domain and possible values ​​for the input given to give accurate results (set of rules regardless of data).

Edit I can get some insight that can be helpful in statistical analysis of live results after proving logic from TDD / development process.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -