ADVERTISER
LINKS
 
activePDF
 
Alexsys
 
Altova
 
Amyuni Technologies
 
Automated QA
 
Axosoft
 
Business Objects
 
Codejock Software
 
ComponentOne
 
Coverity
 
Data Dynamics
 
Developer Express
 
dtSearch
 
Dundas
 
Dynamsoft
 
Hewlett-Packard
 
IBM
 
Imagix
 
Infragistics
 
InstallAware Software
 
InterSystems
 
iWay
 
Kovair
 
LEAD Technologies
 
McObject
 
Microsoft
 
MKS
 
No Magic
 
nsoftware
 
Parasoft
 
Pegasus Imaging Corp
 
Perforce
 
Prezza Technologies
 
Programmer's Paradise
 
Programming Research
 
Rally Software Dev
 
Red Gate Software
 
ScaleOut
 
Seapine
 
Serena
 
Software FX
 
Sparx Systems
 
Swell Software
 
Syncfusion
 
TechExcel
 
Telerik
 
UrbanCode
 
WANdisco
 
Xceed Software
 

 

 
 

 
 

 
 
 

 

 

 
AS OF 7/4/2008 8:32PM EST
JUnit 4 Adds Annotations
By Alex Handy

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.







 
 
 
 
 

SUBSCRIBE TODAY

E-Newsletters:
News on Mon/Thurs.
Test & QA Report
EclipseSource
   

   SUBMIT
 
 
 

     CUSTOMER SERVICE
 
   Download Current
   Issue Now!

   Need Back Issues?
    DOWNLOAD HERE

   Moving? Take
   SD Times With You!
 
 
 
EVENTS CALENDAR
 
Software Industry Conf.
7/17/2008 to 7/19/2008
Boston
Shareware Industry Awards Foundation

Dr Dobbs Architecture & Design World
7/21/2008 to 7/24/2008
Chicago
ThinkServices

Open Source Convention
7/21/2008 to 7/25/2008
Portland
O'Reilly Media

Entity Data Management
7/22/2008 to 7/23/2008
New York
FIMA

Black Hat USA
8/2/2008 to 8/7/2008
Las Vegas
TechWeb

REGISTER
 



 
SD TIMES 100

It's time once again to
recognize the organizations
or individuals that have
demonstrated leadership in
their markets.


 
GET NOTIFIED

On the latest white papers,
software downloads. Web
seminars and conferences.
 
 


                    


Copyright © 1999-2008 BZ Media LLC, all rights reserved. Privacy and Legal

Phone: +1 (631) 421-4158 • E-mail: info@bzmedia.com