Monday, September 08, 2008

The beauty of Unit Tests

I love unit tests. I've become a TDD guy and prefer to do my development that way. I've learned to do that on the back end of projects where it's been easier.

What I haven't gotten into yet is Front End Unit Testing. It's something that I've started with. I've started working with Watir and would like to use JSUnit to unit test more JavaScript, however at this point I'm just working with JUnit on the back end.

The beauty of these unit tests though is that they make it easy to ensure that the entire system still works as expected. At work we are upgrading the OS on our database server and we needed to verify that it would not cause any problems. After the test server was set up it took only 10 minutes to test all of the database functionality. There are many other applications that also use this server, most of which were written before we started using unit tests, and those applications will take a lot more time to test. If we had unit tests in place for all of those applications, they could be fully tested in half of a day.

Patches, OS system upgrades, and even new versions of software can all have unexpected effects on software. Automated desktop testing (even of web applications) can be used to test upgrades of desktop software.

No comments: