2 ms·
I'd like to do testing. The problem is that all the examples of these tests are of modules that work on simple data and produce deterministic outputs. In those
by lutorm 16y ago
I'd like to do testing. The problem is that all the examples of these tests are of modules that work on simple data and produce deterministic outputs. In those cases, I can see how it's easy to set up an automated test.
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?
- darthdeus 16y agoThere'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.