[Opensim-dev] Unit tests should not be coupled (WAS: Re: [Opensim-commits] r8737 - trunk/OpenSim/Framework/Communications/Tests)

Mike Mazur mmazur at gmail.com
Tue Mar 10 08:03:44 UTC 2009


Hi,

On Tue, 10 Mar 2009 08:08:39 +0200
Tommi Laukkanen <tommi.s.e.laukkanen at gmail.com> wrote:

> In my experience the situation is that it is not feasible to write
> unit test for things like repositories without relying in the test
> order inside one test case. So that you can create add, update and
> delete in that order.

But if one of those operations fail (say, create), don't you want to
know that the others are still working? If one test fails the developer
knows exactly where to look.

> My 2 cents: I know what the theory is but in practice to have useful
> test set with reasonable amount of work ordered tests are a good
> pattern.

You're right, it's called Chained Tests[1]. I'm pretty sure by using
fixtures properly in OpenSim's unit tests, the need for Chained Tests
can be eliminated.

Mike


[1] http://xunitpatterns.com/Chained%20Tests.html



More information about the Opensim-dev mailing list