News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 7/1/2009 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
Is the mystery Borland suitor Serena?
Borland software is considering an offer from another company after a preliminary deal with MicroFocus. Is Serena the new company?
06/30/2009 01:55 PM EST

Windows 7 - An eBayer's dream product?
Windows 7 pre-orders can make people money on eBay.
06/29/2009 03:48 PM EST

Know thine cloud provider
Cloud computing require companies to understand compliance and regulation. Third parties will play a big role in regulated industries.
06/29/2009 02:58 PM EST

 

Microsoft Worldwide Partner Conf.
7/13/2009 to 7/16/2009
New Orleans
Microsoft

OSCON (Open Source Convention)
7/20/2009 to 7/24/2009
San Jose
O'Reilly Media

XBRL Technology Workshop & Summit
7/28/2009 to 7/30/2009
Santa Clara
XBRL US

ACM SIGGRAPH
8/3/2009 to 8/7/2009
New Orleans
ACM SIGGRAPH

OpenSource World (formerly LinuxWorld)
8/12/2009 to 8/13/2009
San Francisco
IDG World Expo


 
Most Read Latest News Blog Resources

Happy 10th Birthday, JUnit




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.


Share this link: http://www.sdtimes.com/link/31221
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading