From: Paul Brannan Date: 2003-04-03T00:23:09+09:00 Subject: Re: sharing objects between tests (revisited?) On Wed, Apr 02, 2003 at 07:30:24PM +0900, Francis Hwang wrote: > Paul, > > One thing to think about is why that object is expensive to create and > whether it can be done another way. I don't know anything about the > object you want to test, but I find that if a test is expensive, > that's because: > > 1. The test relies on external resources -- database, filesystem, > network -- and I might be better off writing a mock object to simulate > those resources. > 2. The test relies on extremely complex setup, and I might be better > off trying to break the object down into smaller parts so I can test > its interactions in isolation. Your statements are correct for unit tests. This test is intended to be an integration test for a system that is distributed across a network. In order to completely test the system, the test must make lots of network connections to each of the pieces of the system, so it can validate that the pieces are correctly communicating with each other. I considered trying to test integration between only two pieces at any given time, but implementing such a test would take a very long time, since there is one piece of the system that talks to all the other pieces of the system. Simulating those interactions is a lot of work, since the communication is with CORBA, and Ruby does not speak CORBA well. Paul