Talk:Automated Testing

I crossed out a paragraph about naming tests a certain way in order to make sure they're run in a certain order because they depend on each other. This is bad practice. All tests should be able to run independently of one another. For any environment setup, use the SetUp and TearDown NUnit attributes.

Mikem 01:01, 9 October 2008 (PDT)

I changed this back, because it's the way the unit tests work today. The "theory" that no test method should depend on any other one tends to force unit tests into very shallow coverage because you would need massive code duplication to test anything deep. My experience has shown that imposing the "no test should really on another test" generates much worse test cases.

If you want to go through the unit tests and adjust them to all have Setup and Teardown methods, be my guest. :) However it really just makes things much more difficult than they need to be, for lots of effort, and no real benefit.

---

While my experience hasn't yet shown that test which depend on other tests are the ultimate evil, I'm confident that one should strive to avoid such a situation. The argument against chained tests stating that massive code duplication is necessary to test anything deep isn't convincing because good use of test fixture SetUp/TearDown eliminates most of the duplication.

Chained tests probably do have their place in extremely complicated systems, however I'm not convinced the components of OpenSim that are being tested have not reached such a level of complexity.

Mikem 08:54, 12 March 2009 (UTC)