Unit-testing a complex algorithm -
how write tests testing solution rather complex algorithm the n queens problem? mean should right approach testing algorithm that
has many solutions (you don't know / don't care how many of them exist),
you can have small subset of possible solutions, and
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
Post a Comment