JUnit 4 has been on the streets for almost 2 years and it appears that it is readily being embraced based upon the data thus far gathered from an informal poll. While it’s no surprise that a majority of respondents (40%) are still using the bellwether of developer testing (JUnit 3.8.x), it is rather impressive that the second most popular framework is JUnit 4 at 33%.
Interesting, too, is that TestNG is not too far from JUnit 4 in terms of votes. To be even on the map in the face of such a giant is an impressive achievement.
The question still stands though– if you are a Java developer, what test framework are you using?
For more information on these frameworks, check out:
- Jump into JUnit 4
- In pursuit of code quality: JUnit 4 vs. TestNG
- TestNG Makes Java Unit Testing a Breeze
- JUnit Primer
- Unit Testing in Eclipse Using JUnit

July 23rd, 2007 at 1:27 pm
JUnit 4.4 was recently released, and the new syntax it introduces looks very promising. Perhaps having a fluent interface for testing will help give JUnit an edge in the near future?
Here’s a writeup of some of the new syntax, as well as other new features:
http://www.artima.com/forums/flat.jsp?forum=276&thread=210719&start=0&msRange=15
July 24th, 2007 at 12:10 am
I’m still on JDK 1.4 and therefore sticking with JUnit 3.8.x for the moment. Overall JUnit has become a very powerful framework thanks to support from other projects. E.g. Spring, MockStrutsTestCase etc…
I don’t see my self moving to any other test framework now that I got all these frameworks integrated together to perform unit and integration testing.
July 24th, 2007 at 9:52 am
I use JUnit 4.x when I can. I especially like the @BeforeClass and @AfterClass annotations, which let me to setup and cleanup stuff once before and after all tests in a class.
July 24th, 2007 at 12:43 pm
We switched PMD’s test cases over to JUnit 4 and it’s worked out well; the annotations are handy (especially expected=FooException.class) and using static imports cleans things up nicely too. Good stuff.