Hi Dion,

> I would like to know if it is possible that Unit tests become just
> that, unit tests. 

Yes!  And this is what we hope to do in the not too distant future.
 
> It would be great if there was a policy in place which forced
> developers to setup and destroy their dependencies per testSuite /
> case.  
> This way not only will the cascading test dependency be resolved, but
> it will eliminate the fragility of the current ApplicationTestSuite. 

As you have no doubt discovered, there are very few true unit tests in
the current ApplicationTestSuite.  As you point out, a unit test should
be self contained so that success or failure does not affect any other
unit tests.  In the current code base most of the tests do not meet this
criteria and usually a failure in one test will affect many other tests.

In addition to this, a unit test should test only the functionality of
the particular class under test.  Most of the current tests involve not
only the class being tested but the entire application including the
database.  So most of the current tests would be better classified as
functional tests.  The fact that the database is involved in most test
cases is one of the reasons that the test suite takes so long to run.

After we complete work on the 1.1 release of Mifos, reworking the whole
test suite is one of the things that is high on our list of priorities.
Some of the main goals of this work will be:

* eliminating dependencies between tests. Currently some tests depend on
running before or after other tests.
* making each test self contained.  A failure in one test should not
affect any other tests.
* making current tests into true unit test by removing dependencies on
other parts of the application.  This can be achieved by writing
dependent classes to interfaces and then mocking or stubbing out those
interfaces for testing purposes.
* reducing the runtime of the test suite.

Cheers,
--Van

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to