JUnit 4 Adds Annotations



Email    print   
February 15, 2006 —  Annotations and support for Java 5 are key new features of JUnit 4, and the first beta of the updated open-source unit test tool is now available for download.

Kent Beck, co-author of JUnit, said, “Our goal has always been to have a very simple, appealing tool to support testing for programmers. Programmers, generally speaking, figure their plates are full, so adding testing to that can be a challenging sell. So we’ve always tried to design JUnit so that it was the minimal barrier of entry to write tests. We’re using Java 5 annotation facilities to make test-writing easier. What we discovered along the way is that we were able to add some significant flexibility to the framework.”

The new version, which should be ready for release this summer, will include a smaller, more concise API that is more powerful and easier to use, Beck said.

Beck said that JUnit 4 also was heavily influenced by NUnit, a .NET unit testing tool. NUnit introduced annotations as a method of writing tests into code.

Andy Glover, CTO of unit testing tool provider JNetDirect, welcomed the update, saying JUnit had not supported some methods Glover said he uses.

“JUnit is somewhat inflexible in the sense of there is this notion of fixtures in JUnit—of your setup and your teardown,” he said. “The JUnit model is very strict in the sense that you have to have a fixture for each test case.

“Another thing you can’t do very well in JUnit is group tests,” he continued. “A true unit test should run in a couple of seconds. Then there are integration tests, but they use a database or a file server. Then there are system tests. But as you go up that stack, the test case itself takes a lot longer to run, and that’s where test grouping comes into power. I can run those tests at different frequencies. I wouldn’t want to run my integration tests every time I check in code, because they take a long time.”

Aside from test grouping, all the issues Glover had with JUnit have been addressed in JUnit 4. Group tests, also known as categorizations, Beck said, will be addressed in a future release—not in the initial release of JUnit 4.





Share this link: http://sdt.bz/29153
 
Most Read Latest News Blog Resources

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
LoadRunner wins big again in Testers Choice Awards
Hewlett-Packard raked in many honors this year, spearheaded by its LoadRunner performance testing software. Eclipse, IBM and Parasoft also had strong showings in this year's awards Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb