in reply to Testing with non-trivial input
Let me suggest a compromise. Do generate your tests with code. Then check them by hand, using, e.g. a sheet of paper and a pencil and then happily use them to test your production code.
That means, automate several steps in generating tests. Never test your code with another piece of untested code. I fell into this trap once or twice and it hurts when you suddenly discover that you have just tested that func($input) eq test_func($input) for all inputs while having both these functions identical.
It's very nice to have the so called "reference implementaion" handy for exactly such cases.
|
|---|