The Artima Developer Community
Sponsored Link

Java Buzz Forum
JUnit, Kinda Open Source and Abandonment as a Virtue

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Stirling

Posts: 54
Nickname: sstirling
Registered: Jan, 2003

Scott Stirling is a Senior Software Engineer at Workscape, Inc.
JUnit, Kinda Open Source and Abandonment as a Virtue Posted: Sep 10, 2003 11:21 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Scott Stirling.
Original Post: JUnit, Kinda Open Source and Abandonment as a Virtue
Feed Title: Blaug Blawg Blog
Feed URL: http://users.rcn.com/scottstirling/rss.xml
Feed Description: Java Testing, Tools and Engineering
Latest Java Buzz Posts
Latest Java Buzz Posts by Scott Stirling
Latest Posts From Blaug Blawg Blog

Advertisement

I read this comment in an article by Bryan Dollery at InformIT linked to a JUnit extension I was reading up on. The sentiment expressed in the article, extolling the virtues of JUnit, is one I hear a lot in books, articles and such:

"JUnit has to be kept simple, so the creators haven't added the many features that developers have requested. Instead, they built the core framework so that it was easy to extend. Now developers choose just the libraries they need."

The wording would nicely sum up JUnit's feature status in the open source world, if only it wasn't delivered with such reverence: "the creators haven't added the many features that developers have requested." Period. OK, sure, they made it easy to extend. I mean, you can extend TestCase (obviously), but extending junit.framework.TestCase to write regular test cases obviously isn't what is meant when people praise JUnit's small codebase, simple API, and "extensible" framework. How many of you have tried extending one of the TestRunners? Or implementing a TestListener and registering it with one of the existing TestRunners? You can't do either by pure extension because you have to work around limitations that hinder extensions from overriding the TestRunners' default OutputStream for reporting, and if you implement a TestListener you have no working way to register the listener with an existing TestRunner.

In case you didn't realize it, most of the popular "extensions" that people have made to supplement JUnit are test runners that don't extend anything in JUnit, like Ant's <junit> and <batchtest> tasks and Artima's SuiteRunner, or are specialized extensions of TestCase or TestDecorator, such as Log4Unit, JUnitPerf, XMLUnit's XMLTestCase, etc.

JUnit's greatest contributions to Java development and testing are the Assert and TestCase classes. Kent Beck and Erich Gamma established the de facto standard API for unit testing in Java with those two classes, really. They ship JUnit with a couple simple little test runners, which were enough to get people hooked (those and the concurrence of JUnit's rise to fame with Martin Fowler's Refactoring book and the XP series of books). JUnit has some nice examples of design pattern usage in the code, and it's package design is a perfect acyclic dependency graph. But don't let anyone tell you it's "easy to extend" or lead you to think it's some jewel of extensible object oriented magic that's so perfect it needn't be polished up.

The fact is, JUnit is pretty much abandoned out there on Sourceforge. Call it a virtue if you want, but don't tell me JUnit 3.8.1 is complete or even "good enough." It can hardly be called an open source project in the same sense as something like Eclipse, Apache Geronimo, Jakarta Tomcat, MySQL, etc. because there are no active committers. And there won't be as long as Kent and Erich keep it locked up for fear of people actually implementing some of the many features that people have asked for. So JUnit is open source, but I wouldn't call it an open source project right now.

Anyway, until then, at least the source code is released with JUnit so you can fix bugs and write extensions yourself if you need to. Next topic.

Read: JUnit, Kinda Open Source and Abandonment as a Virtue

Topic: Morphing cellphones into game consoles Previous Topic   Next Topic Topic: Bayesian Filtering: The Spam Fights Back

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use