BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JUnit Still Not Dead

JUnit Still Not Dead

This item in japanese

JUnit is a unit testing framework for Java which has been around for years. It was originally developed by Kent Beck and Erich Gamma and is now maintained by the community which has recently released JUnit 4.5. In the many years that JUnit has been around numerous projects in the xUnit family have been spawned including: Even with years of development effort and usage on countless software projects around the world some continue to wonder if JUnit's fate is nearing its end. Often times when someone (or some group) of people begin to doubt the long term existence of a software project they will rely on web page viewing statistics. Just this week Mike blogged about the declining "interest" in JUnit based upon search engine results. Although he concludes by stating he doesn't believe JUnit is dead there seems to be some inclination that perhaps JUnit is being surpassed.  One reason might be that as newer and better software practices evolve more and more developers catch on to them. Unit testing is certainly important and widely accepted, however, behavior driven development, mock objects and newer-featured unit testing frameworks are standing in the spotlight.

One framework which is often compared to JUnit is TestNG, a testing framework inspired by JUnit. Michael Minella provides a brief but useful comparison between JUnit and TestNG.

Feature JUnit TestNG
User Defined Life Cycle check check
Test Organization (groups, etc)   check
Distributed Test Execution   check
Parallel Test Execution   check
Data Driven Tests   check
Dependency Testing   check
IDE Integration check check
Ant Integration check check
Maven Integration check check
Domain Specific Extensions (Database, HTTP, etc) check  
Active Community check check
source


To summarize his thoughts, JUnit has been adopted and extended more so than TestNG, however, TestNG seems to offer more functionality and has the ability to invoke JUnit tests, making it a tempting choice in testing frameworks.

In conclusion, JUnit may not be in the spotlight as much as it was a year ago, but is it really walking closer towards the 'bright light'? What do you think, what does the future have in store for JUnit?

Rate this Article

Adoption
Style

BT