Skip to main content

QuickCheck for Java Generates Data for Automated Software Testing

Posted by editor on June 16, 2009 at 5:42 AM PDT

QuickCheck for Java is an automated software testing tool that tests programs by generating specified randomized input data sets and running them through the application. The software applies the techniques implemented in the Haskell QuickCheck tool to Java applications. QuickCheck for Java Version 0.4 was recently released.

QuickCheck is a lightweight specification based test tool. Each specification is tested with generated test cases.

Basically quickcheck is about generators of data. (The QuickCheck.forAll method is just a fancy for loop implementation.) Quickcheck can help in scenarios where whole classes of test cases have to be tested and it is not feasible to write tests for all distinct test scenarios. (E.g.: "This algorithm has to work for unicode string values of unlimited size.")

Version 0.4 enhancements include:

  • annotation-based characteristic definition for junit4
  • new CombinedGenerator generators: - int[]; set; sortedLists; non-empty list; lists(Generator integers, int lo); lists(Generator integers, int lo, int high)
  • new PrimitiveGenerator generators: dates(TimeUnit precision); dates(long low, long high); strings(maxSize); integers(int low); positive integer; positive long generator

The value of QuickTest is that it enables you to automate testing of systems using the full variety of input data that the application may encounter when it goes operational. I have done lots of work on complex automated data analysis systems, and testing the systems in advance of their becoming operational is difficult. Manually generating input data takes time. A tool like QuickCheck automates this, and enables exercising the software over a wide set of data conditions. Hence, it allows you to find situations where an particular set of input data causes problems. Once these conditions are found, you can correct the software such that it reacts in an appropriate manner, thus avoiding the undesirable situation of the software failing once it becomes operational.

The QuickCheck project has a To-Do List for the upcoming Version 0.5 and beyond. The project is seeking help with these items, as well as with the development of sample code and documentation. If you'd like to help, visit the QuickCheck for Java home page, scroll down to the bottom, and get in contact with the development team.

In Java Today, Thomas Jung announces Quickcheck for Java Release 0.4 is now available: " We would like to announce release 0.4 of QuickCheck for Java (, a implementation of QuickCheck with major enhancements (distribution functions, generator strategies, rerun of failed test instances, deterministic generators). Quickcheck supports Specification-Driven Development (SDD), which is a recent attempt to address some limitations of TDD by raising the level of abstraction. Like TDD, SDD is an incremental process that proceeds from failing specifications to passing code, and emphasizes short cycle time comparable to TDD."

The JUGs project invites Java User Groups worldwide to enter their information so they can be included in the worldwide JUGs map, which shows the geographic location, leaders, and web site information for JUGs from around the world. It's fairly simple to add your JUG to the map. The current map itself is quite impressive. But, surely there are JUGs that are not represented. It's difficult to believe, for example, that there are no JUGs in Japan. Only one in China? Just two in India? None in South Korea, South Africa, or Mexico? If you're a member of a JUG that's not on the map, please take a few moments to add your JUG to the map.

And Gavin King reports JSR-299 Proposed Final Draft submitted: "I just submitted the Proposed Final Draft of JSR-299, Contexts and Dependency Injection, to the JCP. Download it here[1]. We're gearing up for a final release in August, in time for the Java EE 6 release in September. Thanks to everyone who put so much effort into this! If you have not being paying attention to 299, now is a great time to get up to date. This is arguably the most significant enhancement in EE 6, providing the following suite of functionality: a completely general typesafe dependency injection model..."

In today's Weblogs, Roberto Chinnici has published Slides for my JavaScript talk at JavaOne 2009: "I put the slides for my technical session at JavaOne online here. The session is: TS-3802, Functional and Object-oriented Programming in the JavaScript Programming Language. The repetition of the word "programming" is entirely due to lawyer intervention, I should note...."

Amy Fowler presents the Insider's Guide to Blending Swing and JavaFX: "Responding to requests at JavaOne for more information about using Swing with JavaFX, I've written a 10 step guide for using JavaFX to create a not-so-extreme GUI Makeover for Swing applications."

And Jean-Francois Arcand writes about Getting started with the Atmosphere Framework part III: Dead Simple async REST application: "In that part, I describe a dead simple asynchronous REST application using behaviors.js, prototype.js and the Atmosphere Framework. As usual, you can deploy the app anywhere!"

In the Forums, adamspe is trying to connect a .NET/C# client to Metro web service: "I am running several Metro/WSIT (java source based) web services on tomcat and I'm attempting to verify interoperability with a C# client but cannot at all get it to consume the WSDL metro exposes. I'm using Metro 1.5 which claims interoperability with .NET 3.0 although I'm not exactly certain what that means since I haven't seen any examples or materials that show this working. I'm particularly interested in getting a C# client to deal with a Saml Sender Vouches secured web service does anyone know of any good resources or examples along these lines? ..."

Barry van Someren is working on Clustered setup (think Cloud) Glassfish v2 or v3?: "All, I've been using Glassfish for a few years now and am a strong believer in it's capabilities and stability along with Sun Web server 7. My experiences have mostly been with single server setups. Lately I've been working on setting up Java based hosting and I'm looking for some opinions. My hosting setup is based on a combination of Cloud Nodes (much like EC2 only with both monthly and hourly options) and physical hardware (for MySQL databases, since running these of a shared SAN is a bad idea) I was thinking that Glassfish is moving more and more into the direction of being an excellent cloud based hosting environment..."

And sbeard has a problem with Glassfish Message broker shutting down unexpectedly on its own: "We are running Glassfish Enterprise Server 2.1 on SUSE Linux 10.1. In Glassfish I created a standalone remote broker so that all applications would have a common broker to use for JMS and not the broker it creates with each standalone server you create. This way the starting and stopping the broker is independent of starting/stopping the standalone server and every standalone server has the same remote broker to use. So I have the Java Message Service settings in each standalone server configured to connect to this broker in remote mode. I created the remote broker this way... "

The current Spotlight is the Sun Developer Network article The Java NIO.2 File System in JDK 7 : "Janice J. Heiss and Sharon Zakhour provide an update on The Java NIO.2 File System in JDK 7 : "JSR 203, a major feature of JDK 7 under the leadership of Sun software engineer Alan Bateman as an OpenJDK project, contains three primary elements that offer new input/output (I/O) APIs for the Java platform: An extensive File I/O API system addresses feature requests that developers have sought since the inception of the JDK..."

This week's Poll asks Will there be a JavaOne Conference in 2010?. Thursday will be the last full day of voting.

Our Feature Articles include today's new article by Thomas Kuenneth, Hacking JavaFX Binding. In this article, Thomas describes how to apply binding within JavaFX in a manner similar to what can be accomplished using Beans Binding (JSR-295). We're also featuring Gary Benson's Zero and Shark: a Zero-Assembly Port of OpenJDK, which tells the interesting story of how the Java group at Red Hat developed a cross-platform OpenJDK port.

The latest Java Mobility Podcast is Java Mobility Podcast 80: Java at FIRST 2010 Competition, in which Eric Areseneau talks about Java now being available for the FIRST 2010 Competition.

The latest OpenJDK Podcast is

The latest JavaOne Community Corner Podcast is


Current and upcoming Java

Registered users can submit event listings for the href=""> Events Page using our href="">events submission form.
All submissions go through an editorial review before being posted to the

Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

QuickCheck for Java is an automated software testing tool that tests programs by generating specified randomized input data sets and running them through the application...