Co-author of "Continuous Integration"
Andrew Glover is the President of Stelligent Incorporated, which helps companies address software quality with effective developer testing strategies and continuous integration techniques that enable teams to monitor code quality early and often.Andrew was the founder of Vanward Technologies, which was acquired by JNetDirect in 2005. He is the co-author of Addison Wesley's "Continuous Integration", Manning's "Groovy in Action" and "Java Testing Patterns". He is an author for multiple online publications including IBM's developerWorks and Oreilly's ONJava and ONLamp portals. He actively blogs about software quality at thediscoblog.com and testearly.com.
Presentations by Andrew Glover
Easy Behavior Driven Development
Behavior-driven development, or BDD, has attracted a lot of attention via RSpec in the Ruby community, but BDD's roots stem from JBehave, a Java based framework modeled off of the xUnit paradigm.Forget quality-- it's all about speed
The discussion around Agile software development often times centers on the notion of increased software quality-- while this is a benefit of disciplined Agile software development, quality doesn't sell. While surveys often site quality as a prime concern of businesses, quality rarely gets attention when it comes to budgets. Try as you might, if you wave the quality flag, you'll be ignored. On the contrary, speed is what sells. The beauty of Agile, of course, is that if you do it right, you get both increased software quality and most importantly, a faster delivery speed.The Disco Blog
Can you dig it man?
Tuesday, July 1, 2008
Dan North, the veritable progenitor of behavior driven development (or BDD), recently blogged about unnecessary DRYness (meaning don’t repeat yourself) with respect to clarity of intent when it comes to testing (in generic terms of the word). Essentially, in the case of a JUnit test, for example, by utilizing a setUp method and possibly other helper methods, the test itself becomes somewhat cluttered– one must jump around the code to truly understand the intention of the test in the first place. 
In fact, Dan says it quite nicely– tests (or stories, baby) are:
“examples [that] tell a story about what the code does… [and] clarity of intent is found in the quality of the narrative, not necessarily in minimising duplication.”
Thus, over utilizing the DRY principle can be ineffective when it comes to testing; indeed, he makes a great point! If tests or stories are intended to serve as “executable documention” doesn’t it make sense to make them as easy to read and understand as possible?
As such, because it’s my bag, I took the liberty of pondering the depth of favored term DRY and decided that when it comes to clearly expressing intent with respect to stories (as in the case of easyb) or tests, it often pays to be WET– that is, wholly express your tactics, baby.
You see, applying WET to, say, an easyb story then yields perhaps more text, but it leaves no room for misinterpretation, man. For example, imagine a story regarding discounts (this is my touchstone example that is in danger of itself becoming dry– no pun intended either, man). The high level story is such that VIP customers receive varying discounts depending on the amount of money a particular order has– you could even require a minimum number of items too (if you were attempting to move inventory). Thus, one scenario could be:
scenario "VIP customer with 3 items, over $30 receiving 10% discount", {
given "a VIP customer"
and "given they have at least 3 items totaling over $30"
when "they proceed to checkout"
then "they should receive a 10% discount"
}
Of course, from here, stakeholders, through a collaborative effort, realize more scenarios are possible– for instance, the VIP customer has 3 items totaling over $100– thus, a higher discount is applied. A first stab of staying WET (that is, wholly expressing your tactics, man) yields this scenario:
scenario "VIP customer with 3 items, over $100 receiving 15% discount", {
given "a VIP customer"
and "given they have at least 3 items totaling over $100"
when "they proceed to checkout"
then "they should receive a 15% discount"
}
Reading these scenarios (which are executable, by the way!) leaves no room for missing the boat– the tactics involved are wholly expressed!!– reading them is somewhat effortless from the standpoint that you don’t necessarily need to jump around the file to gain a clear understanding of context.
If you prefer staying DRY, the story can become more concise–
before_each "a VIP customer with 3 items is assumed", {
given "a VIP customer"
and "given they have at least 3 items"
}
scenario "VIP customer with 3 items, over $30 receiving 10% discount", {
given "the 3 items total at least $30"
when "they proceed to checkout"
then "they should receive a 10% discount"
}
scenario "VIP customer with 3 items, over $100 receiving 15% discount", {
given "the 3 items total at least $100"
when "they proceed to checkout"
then "they should receive a 15% discount"
}
Both stories convey intent– it is just that the WET one is more clearly expressed– in the DRY example, as more and more scenarios are added (and they surely will), one needs to jump to the top to gain an understanding of the underlying assumption (that is, a VIP customer with 3 items in their shopping cart).
DRY is fundamentally a sound principle– I’m not here to deny that; however, like all good things, it can be overused without regard for a particular situation. In fact, Johann Wolfgang von Goethe (of Faust fame, baby) is quoted thus:
“The phrases that men hear or repeat continually, end by becoming convictions and ossify the organs of intelligence.”
Because it is everyone’s bag, baby, think through DRYness from time to time and realize that in some cases, it is perfectly acceptable to WET yourself (I mean, to practice WET). Can you dig it, man?
Monday, June 30, 2008

The easyb team is pleased to announce the release of easyb 0.9, baby!
The 0.9 release has:
- Numerous IntelliJ plug-in improvements
- The easyb plugin for IntelliJ can now be downloaded directly from within IntelliJ! See http://plugins.intellij.net/plugin/?id=2916
- Various fixes and improvements addressed from issue tracking system
- Fixtures!
- More enhanced error reporting
narrativesupportdescriptionsupport
easyb supports capturing additional hip information regarding stories, such as a story’s description and some detail regarding the features, benefits, and roles of a persona related to a story. For instance, the DSL now supports a description syntax that takes a String value — single quote or Groovy’s triple quote trick.
description "some description"
scenario "text"
or
description """some long description that requires
multiple lines, etc
"""
scenario "text"
What’s more, you can provide additional details of a story via the narrative syntax:
description "text"
narrative "description", {
as_a "role"
i_want "feature"
so_that "benefit"
}
scenario "text"
Both the narrative and description keywords are optional and they don’t have to be used together– i.e. you can use the narrative one without providing a description. These aspects will be captured in the output (i.e. story report) of an easyb run too.
From a fixture standpoint, easyb supports both one time fixtures (before) and for each scenario (before_each). Of course, you can add tearDown-like behavior in after and after_each.
You can download the latest release from easyb’s Google code page.
Sunday, June 29, 2008
- Agile Smells: Don’t Let This Happen To You!- I wonder how we went from “Individuals and interactions over processes and tools” to cataloging the manifold ways to practice Agile?
- Agile Versus Lean- Speaking of Agile, man, Martin’s got something to say.
- RSpec-1.1.4- Yeah, I’m a month late to this party; nevertheless, way to go team!
- Article: Best Practices for Model-Driven Software Development- Apparently, MDD “no longer belongs to the fringes of the industry but is being applied in more and more software projects with great success.” That’s super news, baby.
- Java Private Constructor Cleverness?- My friend, Hamlet has a clever format of this blog– well done, friend!
- My “Unit Test” Aint Your “Unit Test”- Great read!
Wednesday, June 25, 2008
It’s clear that the initial bogue bet on Java’s ubiquity in the browser, in the form of applets, never paid off– history, however, has shown that Java found its foothold on the server-side. Nevertheless, because it’s everyone’s bag, applets are still around as I run into them from time to time. Interestingly, Sun has been putting some effort into underlying engine that runs applets (the Java plug-in), which begs the question– are applets still alive? What’s more, if they aren’t (or are on life support as some have suggested), what happened to them?
Richard Monson-Haefel recently pointed me to an hip conversation with everyone’s favorite disco superstar, Ted Neward (who you may have heard blather on and on (and on!) about Scala recently) who yammers (on and on and on– in reality, only 15 minutes but they do cut him off as he’s chattering on and on and on!) about why he thinks applets effectively kicked the bucket.
Just the same, Sun hasn’t thrown in the towel! In fact, not long ago, I had the privilege of conducting a dialog with Ken Russell, a Sun engineer focused on rebuilding the Java plug-in. According to Ken, applets aren’t dead yet and are a compelling platform for building Rich Internet Applications.
Both conversations are appealing in that they shed some light on the lessons learned about Sun’s initial applet bet and where the future may be headed (regardless if applets will be with us or not). For me, I’m not sure applets are dead just yet– Ken gave me reason to believe otherwise. Have a listen to both Ted Neward and Ken Russell and decide for yourself, man!
Thursday, June 19, 2008
I recently had the opportunity to discuss Scala with my friend Ted Neward for JavaWorld’s Java Technology Insider. Ted’s been talking about Scala for quite some time now and he’s the person who turned me on to this compelling functional language.
In this conversation, Ted explains what functional programming is and why people should care– he’s got some interesting thoughts regarding OO languages versus functional languages and more importantly, where each paradigm is a good fit. Scala’s definitely got some interesting features– if you are curious to hear them, then have a listen, man!