Stelligent Home Page
CONSULTING  •  COACHING  •  COLLABORATING

Quick Links
 

An Interview with TestNG's Cedric Beust

Dynamic Languages »
« An Interview with TestNG's Cedric Beust



JUnit 4


News that an updated version of JUnit was under development received a lot of attention- what are your thoughts on JUnit 4?
JUnit 4 is a fairly conservative evolution of JUnit 3 that incorporates more modern techniques (annotations) and new ideas (groups). I know by experience that it's very hard to convince JUnit 3 users to change their thousands of existing tests, so backward compatibility and migration paths will be key to the success of this new version (something we also took very seriously with TestNG, hence providing a JUnit runner and various tools to convert your JUnit tests automatically).

Once JUnit 4 is released- what is TestNG's value proposition?
JUnit remains a unit testing framework (emphasis on "unit") and Kent and Erich seem to be adamant on sticking to this core principle, which is a good thing.

First of all, let me share with you my definition of a unit test: a unit test is one or several methods that exercise the functionality of a class in isolation of all others.

Unit testing is only a small part of the art of testing in general, so I think that from a philosophy standpoint, the two frameworks have marked differences that should make it easy for users to decide which one to pick.

There are also a few features that are clearly out of scope for JUnit 4, based on Kent's messages on the JUnit mailing-list these past weeks, among which are JDK 1.4 support, dependent methods and the separation between static (what your tests do) and runtime (which tests are run) models. I feel very strongly about all these features and I know for a fact that JDK 1.4 support provided a huge increase in acceptance for TestNG.