ReportNG 0.9.8 – HTML and XML reports for TestNG

Posted in Java by Dan on October 21st, 2008

Version 0.9.8 of ReportNG is now available for download. This version addresses a couple of issues with the XML output from the JUnitXMLReporter:

  • The XML output now includes failed and skipped configuration methods.  Previously these were included in HTML reports but omitted from the XML.
  • You can now control the dialect of the XML that is generated.  The default is to use the version that TestNG’s own reporter generates.  This includes the ability to mark tests as skipped and works well with Hudson.  Not all tools recognise the <skipped> element though, so you can now set the org.uncommons.reportng.xml-dialect property to "junit" (as opposed to "testng") and it will mark skips as failures. This works better with Ant’s junitreport task.

In addition, there have been a couple of enhancements to the HTML reporter:

  • There is now a separate page that collates all of the reporter log statements.
  • You can now specify your own stylesheet to over-ride the default appearance of the generated report.  Just set the org.uncommons.reportng.stylesheet property to the path of your CSS file. For example, the sample report looks like this when using a custom Hudson-inspired stylesheet.

Thanks to Ron Saito and Mike Feinberg for the feedback and suggestions that were incorporated into this release. If you have any problems, please use the issue tracker. And if you come up with a good custom CSS file for the HTML reports, please consider submitting it so that it can be included in the distribution.

Java Power Tools

Posted in Books, Java by Dan on October 13th, 2008

I’ve been keen to take a look at John Ferguson Smart‘s Java Power Tools since I first found out about it. Fortunately, it has just been added to the ACM’s online books programme so, as an ACM member, I’ve been able to read it online.

The book consists of 30 chapters, each dedicated to a different development tool. Build tools, version control, continuous integration, testing, profiling, static analysis and issue-tracking are among the topics covered. For most tasks, more than one option is presented. For example, the book covers both Ant and Maven, and JUnit and TestNG. All of the tools covered are open source and freely available.

Java Power Tools

Some of the chapters will only be of interest to beginning Java developers. I imagine that most Java professionals already know how to use Ant and some kind of version control system. On the other hand, the book also introduces some tools which are not so well-known, so you are sure to find something useful here.

CVS and Subversion are the version control options demonstrated. I can’t help thinking that Git (or even Mercurial) would have been a better choice for inclusion than CVS.  Usage of distributed version control systems is growing whereas CVS has effectively been supplanted by Subversion.

Elsewhere there are no such omissions. The author covers four different continuous integration servers: CruiseControl, Continuum, LuntBuild and Hudson. This is probably overkill. I haven’t used LuntBuild, but I would quickly dismiss CruiseControl and Continuum in favour of Hudson. It would have been sufficient to cover Hudson and one other.

The coverage of testing tools is particularly thorough, and is probably the most useful part for experienced developers. Not only does it cover JUnit 4 and TestNG, but it also goes into some detail on a variety of related tools, such as DbUnit, FEST and Selenium, and performance testing tools including JMeter and JUnitPerf.

I found the chapter on the JDK’s profiling tools to be useful and there is also a chapter on profiling from Eclipse, but nothing on the NetBeans profiler. This is my only real gripe with the book. Three of the chapters are Eclipse-only with no alternatives offered for users of other IDEs. One of these is the chapter on the Jupiter code review plug-in. ReviewBoard might have been a better choice.

All-in-all though, this is a substantially useful book. At 910 pages it covers a broad range of topics without skimping on the necessary detail. There are dozens of ideas for improving and automating your software development processes.

If you want more information, Meera Subbarao at JavaLobby has also reviewed Java Power Tools.

Distributed Evolutionary Algorithms with Watchmaker and Hadoop

Posted in Evolutionary Computation, Java by Dan on October 1st, 2008

One feature that has been on the TODO list of the Watchmaker Framework for Evolutionary Computation for some time is the ability to distribute the evolution across several machines.  Some time last year I started on a RMI-based solution, but I wasn’t happy with it so I deleted it and put the idea on the back burner while I concentrated on other things.  At some point I wanted to investigate using Terracotta, or possibly Hadoop, to distribute the computations.

However, it’s often the case with Open Source software that somebody smarter comes along and does the hard work for you.  I was delighted to find out today that Abdel Hakim Deneche has been busy integrating Watchmaker with the Apache Mahout project as part of Google’s Summer of Code programme.

I’d never heard of Mahout before.  According to Wikipedia, a Mahout is somebody who drives an elephant.  Apache Mahout is a sub-project of Lucene, the Java text search and indexing engine.  The Mahout project is focused on building scalable machine-learning libraries using Hadoop (presumably where the elephant connection comes in).

I haven’t yet tried using the Mahout software, but it looks like it provides a pretty straightforward way to distribute the fitness evaluations for just about any evolutionary algorithm implemented using Watchmaker.