Groovy in session at Über Conf 2011

Friday, July 22, 2011

Denver, CO July 12-15, 2011

The best possible outcome for a developer attending a software conference is to leave feeling inspired and invigorated — anxious to explore new tools & technologies while gaining no more than 10 pounds in cookie-weight. NFJS had assembled an impressive variety of sessions, but I opted to focus on those related to the Groovy ecosystem, plus a few Scala and NoSQL sessions to escape my comfort zone. I’ll further limit my observations below to three Groovy-based tools in particular — Spock, Geb, and Gradle.

I was especially anxious to attend a few sessions on Spock, a testing framework for Java and Groovy code created by Peter Niederwieser of Gradleware. I was already familiar with the framework from prior project work, but I hoped to gain a more complete understanding of the tool and learn some best practices. The conference offered a unique opportunity to sit in on a few sessions with the man himself, and it was tremendously helpful to see some concrete examples of the slick, highly expressive Groovy DSL that powers the framework. For a “pet project”, as Peter describes it, Spock continues to impress me with it’s maturity and excellent documentation. Peter also posted his code and slides from the session on his GitHub page — check them out here:

https://github.com/spockframework/spock-uberconf-2011

Peter also led a session on Geb (pronounced “jeb”), a browser automation tool combining WebDriver and Groovy (pronounced “jroovy” in this context?) with a jQuery-like DOM selector syntax. This was my first introduction to Geb, but I’m excited to wire it in with Adobe CQ5 projects for integration testing; it’s use of Page and Module objects to drive content testing aligns perfectly with CQ5′s page/component models. Interestingly, Peter noted that Luke Daley, the creator of Geb, is a co-worker at Gradleware (and a Spock committer), which bodes well for the future of these relevantly young frameworks. Matt Stine followed with a session on using Geb with Spock to automate requirements, which helped to clarify the mapping from user stories and acceptance tests to Spock specifications. Likewise, the code and slides from these sessions have been posted to Peter and Matt’s respective GitHub pages:

https://github.com/geb/geb-uberconf-2011-example
https://github.com/mstine/exec-specs-geb-spock

A common theme across these presentations was the extensive use of Gradle. Gradle is a build automation tool that utilizes a Groovy DSL rather than XML (e.g. Maven, Ant) for configuring build files. The expressiveness and dynamic nature of the Groovy language allows for a concise syntax, while Groovy’s scripting features enable the addition of functional blocks to eliminate redundant configuration elements. For all the success I’ve had using Maven, I’ve always found it to be a necessary evil — the fragility of XML across multi-module projects causes a lot of headaches, and it’s taken numerous projects to solidify our archetypes. Gradle’s convention-over-configuration approach would be a nice first step in reducing complexity and allowing us to focus on project-specific concerns more quickly. Look for enterprise Gradle adoptions to increase as the already-comprehensive set of plugins (Java, Scala, Android, etc.) continues to expand.

Judging by the attendance of these sessions at Über Conf, there is a tremendous enthusiasm for these frameworks among the Java and Groovy communities — it’s exciting to learn about new tools that promise to make life easier and more productive for Java developers.

In related news, Groovy 1.8.1 and 1.9-beta-1 were released yesterday.

Top