Feb
23
2008

G2X: Andy Glover on Gant & BDD

I’ve been meaning to have a look at both Gant and easyb for a while, so I headed off to Andy Glover’s sessions where he had one on each.

Gant looks pretty cool. Gives you all the power of Ant, but using Groovy imperatives rather than xml. Very cool for branching and doing other funkyness during the build. You also get Ivy bundled in the mix, so you get Maven-like dependency goodness out of the box.

Andy demoed defining closures for common operations (such as compilation) and then doing some cool currying operations to reuse the closure for all sorts of directories and classpaths. (He recommended a good developerworks article on closure currying).

I really need to download Gant and have a closer look, especially for doing build funkyness in Grails apps.

Next talk. easyb is a Groovy implementation of Behaviour Driven Development (which has been getting popular through RSpec support in Ruby-land). The idea is that you are given a Domain Specific Language (DSL) for expressing tests through a very fluent programming model of stories and scenarios.

given "a modified String class", {
    String.metaClass.caps = {
        delegate[0].toUpperCase() + delegate[1..-1]
    }
}

when "caps is invoked" {
   "andy".caps()
}

then "the value should be Andy", {
    value.shouldBe "Andy"
}

You can run easyb tests via an Ant task, Maven2 plugin, or from the commandline.

Andy’s a great speaker and we were a tough crowd. Really engaging.

About the Author: Glen Smith

3 Comments + Add Comment

  • Thanks for taking the time to blog about the conference. I wish I were there!

  • Please, post your slides, please!!!

  • I kind of (theoretically) like the idea of behavior driven testing. However, as far as I know bdd frameworks are built on top of the same xUnit approach which is fitted to unit testing, while I do consider bdd going more into functional testing. Just my opinion,

    cheers,

    ./alex

    .w( the_mindstorm )p.

    ps: glad to have had finally met you!

Leave a comment

Glen Smith

About Glen

Co-author Grails in Action