No more Java purism!
Before I launch into the practical aspects of unit testing with Groovy, I think it’s important to talk about the more general issue of its place in your development toolbox. The fact is, Groovy isn’t the only scripting language that runs on the Java Runtime Environment (JRE), it’s just the only one that has been proposed as a standard language for the Java platform. As some of you will have learned from the alt.lang.jreseries (see Resources), there are myriad options when it comes to scripting for the Java platform, most of them presenting highly agile environments for rapid application development.
Despite this abundance of choices, many developers choose to stick with their favorite and most-familiar paradigm: the Java language. While Java programming is a fine choice for most situations, there is one very important shortcoming to wearing Java-only blinders. As a wise person once put it: If the only tool you have is a hammer, you tend to see every problem as a nail. I think there’s a lot of truth to this saying that is applicable to software development.
Just as I hope to convince you with this series that the Java
language is not and should not be your only choice for developing
applications, it’s also true that scripting languages make sense in some
scenarios and not in others. What separates the professional from the
tyro is knowing when to apply the power of scripting and
when to eschew it.