Unit-testing a complex algorithm -


how write tests testing solution rather complex algorithm the n queens problem? mean should right approach testing algorithm that

  1. has many solutions (you don't know / don't care how many of them exist),

  2. you can have small subset of possible solutions, and

  3. verifying solution correct can little bit tricky (maybe comparable in complexity algorithm itself).

i know these conditions not present in n-queens problem itself, mentioned provide sort of example.

in testing complex algorithms, rely on 'data' needs verified. assume have solutions (data) in form problem. take data , let algorithm run through , see if answers match. take example of solving n-puzzle using algorithm, non-deterministic, have data verify solution.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -