JUnit 4 Adds Annotations
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
Zeichick’s Take: Radio moves from analog waveforms to digital packets
Streaming radio highlights the need for streaming applications to be designed to take up as little bandwidth as possible
|
|
Taking enterprise architecture to the business side
Startup Corso is bringing out a cloud-based planning platform that ties into business plans
|
|
Appcelerator Acquires Cocoafish to Add Instant Mobile Cloud Capabilities to its Industry Leading Titanium Platform
Appcelerator Offers Messaging, Social, Location and Storage Mobile Cloud Services to All Mobile App Publishers
|
|
ComponentOne Releases a Collection of 40+ UI Widgets Powered by HTML5 and jQuery
ComponentOne has announced the 2012 release of Wijmo: a kit of UI widgets for HTML5 and jQuery development
|
Taking enterprise architecture to the business side
Startup Corso is bringing out a cloud-based planning platform that ties into business plans
|
|
Top five apps to manage your workload
Web applications offer new ways to track your “to-do” lists
|
|
Not so fast when it comes to testing in the cloud
Developers face outsourcing, virtual lab management and mobile devices as obstacles
|
|
Xceed releases UX-focused suite for Microsoft’s WPF
"Blendables" helps match user experiences to developer visions
|
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.
|
|
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.
|
|
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!
|
|
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.
|
The Hidden Costs of Software Licensing
Moving beyond paper-based software licensing to more flexible, software-based licensing is a business decision. There is a growing trend tow...
|
|
Case Study: You May Need a Development Mechanic
As a contractor for a major financial player in Germany, SOBEGE, a German-based consultancy specializing in embedded IT and web services, wa...
|
|
Ensuring Software Quality at a Major International Bank
One of the world’s leading international banks has adopted AgitarOne technology for delivering generated unit tests for their Java software...
|
|
Load Testing Adobe Flex Applications
Adobe Flex applications may be different from applications you’ve worked with before. For classic HTML web applications, the server does all...
|