Tuesday, June 10, 2008

Get Agile

Not only is it good practice but in the current environment it is essential that development of new feature is rapid. So with this in mind whether you are starting out on a new project or are adding features to an existing one it is very important that automated tests are built for the application. These tests should be both unit tests and integration tests.
For our unit tests we use JUnit and MockControl. You have probably all heard of JUnit, but possibly not MockControl. MockControl allows you to teach an interface to respond a certain way, thus allowing you to create a stub, but without the need to build a new class. It can check the number of calls made to the stub and it can respond a certain with a certain object by integrating the calling parameter values.
For our Domain layer we use an in-memory database such as HypersonicSQL for this type of testing.
Integration testing is a little more complicated since a certain amount of data needs to be available on the database. For these we use a database of the same type as the production database and load the database using DBUnit.
Next time I will look at automated build and continuous integration using Hudson.

No comments: