Tuesday, August 19, 2008

Unit Testing for Various Languages

Chances are if you are or have used the Eclipse IDE, you have used JUnit.  If you haven't JUnit is an Eclipse plug-in, a testing framework, that provides you a means of creating unit test suites that while supporting Test-Driven Development is also useful for unit testing in the more traditional sense.  It doesn't support GUI testing, though there are other plug-ins that do.  For example, SWTBot may be useful for you though it is not alone.

JUnit has been around for years and has an active community.  It has a new version, JUnit 4.5  JUnit comes with the Eclipse download so there isn't any complex installation needed.  There are some nice examples online showing it in use if you are starting out.

Another unit testing framework, called testNG, is another option worth looking at once you get the hang of how testing frameworks work. It also has an active community and it can be used with Eclipse.  It can be helpful with larger projects where you may want to distribute your testing efforts and have more reporting.  It has other features worth checking out.  If you are making a jump from JUnit to testNG, the site has some help as to how to migrate JUnit tests.

If you have unit testing needs in other languages, you may find the following useful as well:
So don't think such testing frameworks are only for Java or only for Eclipse, as even JUnit and testNG are not Eclipse-specific.

Coverage testing is another area, but I'll leave that for another post. :-)

No comments: