CHANNELS
 
 
 
 
 
 
 
 
ON THE WEB
 
 
 
 
PRINT EDITION
 
 
 
 
BZ MEDIA
 
 
 
 
ADVERTISER LINKS
 
 
 
 
 
LOADING...
LOADING...
 
 
AS OF 8/7/2008 4:28PM EST
Happy 10th Birthday, JUnit
By Edward J. Correia

October 9, 2007 — If you’re part of a team building applications with Java, chances are good that you’re using JUnit for testing.

How good? According to a recent survey released last week by Evans Data, more than seven in 10 use the open-source unit-testing framework first offered by Kent Beck and Erich Gamma in 1997. Overall, 87 percent of Java developers are using a unit-testing tool of some kind.

And I think that’s a good thing for testers. Because the more responsibility developers take for building working code, the less bug hunting you’ll have to do, enabling you to focus on the more important aspects of your job, such as functional and requirements testing and QA.

In the last decade, JUnit has been downloaded more than 2 million times, according to Evans, and is included as a plugin to all major IDEs, including Eclipse. The tool is particularly prevalent in financial services, telecom, retail, manufacturing and IT consulting industries in North America, where an estimated 1.2 million developers use Java. Java usage is even greater in Europe, the Middle East and Africa (EMEA), but unit testing is done less often there and the Asia/Pacific (APAC) area.

And those using JUnit are apparently quite happy with it. Of the 558 responding Java users, nearly two-thirds (63.7 percent) are either extremely or somewhat satisfied with their unit-testing tool. Only 5.2 percent were unsatisfied, and 18.5 percent were somewhat unsatisfied. The remaining respondents said they don’t use unit-testing tools.

There are versions of the unit-testing framework for numerous languages other than Java, including C# (NUnit), C++ (CPPUnit), Fortran (fUnit), Perl (Test::Class and Test::Unit), PHP (PHPUnit), Python (PyUnit). There’s even a version for JavaScript (JSUnit). JUnit’s own site is junit.sourceforge.net.

But even with its wide adoption, which Beck says has far exceeded his original expectations, far too much programming is done without the benefit of tests. “For decades, programmers have ceded responsibility for quality to someone else,” says Beck. “Programmers need to turn this around and insist that their code work before asking anyone else to invest time in it.” There’s also a need for better design skills, which he says will lead to better tests. “To get better tests, you need more skilled programmers making good large- and small-scale design decisions. The tools could still be even simpler and provide higher value. That was the goal behind the latest release of JUnit 4.4.”

Features in 4.4, say the release notes, are designed to “efficiently capture developers’ intentions about their code and quickly check [that] their code matches those intentions.” This is accomplished through a new assertion syntax built by Joe Walnes atop what was the JMock 1 library for test-driven Java development.

A new API is built into JUnit 4.4 with an “extensible and readable syntax,” enabling new features like assumptions, which permits the declaration of explicit dependencies when a tester has no control of forces that might cause a test to fail. Assumptions also give rise to theories, which can capture some aspect of behavior in “possibly infinite numbers of potential scenarios,” according to the notes.

There are numerous other changes, enhancements and bug fixes in the July release of version 4.4. Download it from the JUnit download page.
 


 
 
 
 
 
 
 
 
 
 
SUBSCRIBE TODAY!
 E-Newsletters:
  News on Mon/Thurs.
  Test & QA Report
  EclipseSource
 
 
JOB BOARD
 
PDF & PRINT EDITION
* Requires Resource Account!  LOGIN or SIGN UP

Download Current Issue!
ISSUE 8/1/2008 PDF

Need Back Issues?
DOWNLOAD HERE

Receive The Print Edition?
SUBSCRIBE HERE
 
REGISTER
 
GET NOTIFIED!
About all of the latest Resources
 
 
SD TIMES 100
It's time once again to
recognize the organizations
or individuals that have
demonstrated leadership in
their markets.