Re:Testing is waste of time, I know that my code works
by darthdeus on Friday December 24, 2010 @12:38PM
(#2037633)
There's big difference between integration and unit tests. If you're having trouble writing unit tests, it's probably because your code is too tightly coupled, making it hard to separate one part from another.
When you try to write a project with tests, not necessarily test first, it will enforce certain design. This is almost always a good thing, since you're forced to write modular code.
But a large portion of my code is Monte Carlo, so the only way to see if it works correctly is to evaluate the distribution of the output, which will be correct only in a statistical sense. Moreover, the modules operate on classes with fairly complicated data, so it's difficult to mock up input data without running that part, too.
Why don't anyone show a realistic example of setting up an automated test on a real-life piece of software?