2

Coming from a Java background, learning Groovy seems a not-very-radical way to learn many concepts inherent to dynamic languages.

I am planning to start learning Groovy via

  1. Unit testing my existing Java code with Groovy ( There are many articles on www for it, but what are the cons ? )

  2. Automation Testing via Geb ( Using Spock with Geb )

Are there any problems with this approach ? Better ways to learn groovy and apply as well ? Are there issues with using Spock with Geb ?

2 Answers 2

8

As the author of Spock I might be biased, but

  1. Spock was specifically designed to work great for testing Java code. Cons of testing Java code with Groovy: Second language adds some complexity (although the payoff is big), no other language on the JVM matches Java's tooling (although Groovy probably comes closest; for example, cross-language refactoring in IDEA works very well).
  2. Geb is "just" a library and thus works well with any testing framework (even if no integration is available). How well does it work with Spock? Well, I guess it suffices to say that Luke Daley, the author of Geb, is a Spock committer and uses Spock whenever he can. :-)
0

The way I learned Groovy might be a bit old-fashioned but I just picked up a book and read it. I highly recommend:

Programming Groovy: Dynamic Productivity for the Java Developer by Venkat Subramaniam http://www.pragprog.com/titles/vslg/programming-groovy

It's a very quick, easy and purposeful read. After I read the book I just began coding in Groovy and learned more and more from there.

1
  • 1
    "The way I learned Groovy might be a bit old-fashioned..." -> :)
    – Arun R
    Oct 5, 2010 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.