A Gentle Introduction to Behavior Driven Development – BDD

Avoiding Anger-Driven Development (ADD) using Behavior-Driven Development (BDD)

Ever wondered why so many developers code angry? Well, it’s probably because they just spent 4 days of their lives building the WRONG thing! “Why are they building the wrong things”, you ask? Because gathering requirements, documenting them, and *interpreting* what’s written is complex…*very complex*. Enter BDD.

BDD

BDD enables (requires) consistent conversations between Business Analysts, Developers and Quality Assurance professionals. And that’s important! This simple step turns an angry post-mortem conversation about a misinterpreted feature spec into a delightful (collaborative) welcomed conversation with all participants during the construction of said feature. This presentation will be a gentle, anger-free primer to Behavior-Driven Development. If you want to learn new techniques to facilitate collaboration on your project team, this is the presentation for you!

Contributors:

Kim Merbeth
Jim Cornelius
Jason Montague

Tolerate Failure, Disdain Apathy

Recently I ran across a manuscript that my father was writing some 25 years ago. The topic: how to engage and cultivate greatness in a battered, and oft embittered workforce. My father focused his career managing companies, mostly in the manufacturing sector, so you can imagine the context of the following line:

“If we are to cultivate greatness in our organizations and in ourselves, we must learn to tolerate and acknowledge failure, and have a fervent disdain for apathy.”

Can you imagine what that statement might have meant to a union worker at that time who was all but *commanded* not to care?

Union Labor vs. Knowledge Workers

I can just imagine the union dominated workplaces, the heavy handed bosses who sat up in the plant office looking down at the hired help, and the scores of unmotivated and distrustful factory workers staring back up at them. As I read through the pages, bound together into distinct chapters by binder clips and rubber bands, that one line stood out. It still does. “Failure”, the subject of a few of my recent posts, is something I seem to be exploring these last few months. Mostly because I see it for what it is, for what it truly stands for, and how wrong our command-and-control heritage had it. I also think of how good, comparatively, we have it. Many of my staff have Masters Degrees. Some have had PhD’s. Most are still searching for an organization that will allow them autonomy over their work and a healthy place to practice their craft. I can’t say the same of the factory worker of the 70′s and 80′s. How good I (we) must have it, right?

My father passed away in the early nineties before he could publish his book. He had gotten through six chapters and what notes and collected data that accompanied these six chapters has long since vanished. At the time, I was an awfully young man caught up in endeavors that feel a thousand miles away from this.

Failure is an Option. Stopping is Not.

Fast forward to 2010. I am in the middle of a career spent coaching others, cultivating relationships and friendships, striving for purpose and mastery in the field I have chosen. I now have an opportunity to lead others. To teach. And I hope, in some small way, to inspire. Every day I think about how truly difficult it is for me to discuss these heavy topics in a meaningful way. Every day I feel like I can’t quite pull our teams out of the rut they find themselves in, inching toward some level of congruity and understanding. Everyday it feels like someone in the management hierarchy is willfully subverting *every* effort toward a more sane and rewarding workplace. I know this is not true. But it does FEEL true sometimes…even through the exciting highs and feeling of accomplishment our field provides.

Caring Enough to Do It Again

After finding his book and imagining the “all but impossible” tasks my father must have gone through, I now have a slightly different perspective. Failure is an option and one that must be tolerated and even expected. The hard work, the true heavy lifting, comes in the form of caring enough to do it again. To learn what just happened, revise your strategy, and do it again. The moment you let apathy creep into your day, even *after* a monumental failure, you’ve lost.

Now, everyday (win, lose or draw), I vow to do it again tomorrow and try something new. I do it again – because I care enough about the outcome, the people, and myself – to do it again.

Why is Uncle Bob So Angry?

In my organization, a handful of the teammates have begun to read (and report on) Bob Martin’s book “Clean Code”. One of these gentlemen has even gone as far as sending some of his learnings out in a daily email as a “Clean Code Tip”. Right from the start, email replies started asking one rather obvious question, “Why is Uncle Bob so angry!?” He uses phrases like, “There is hardly anything more abominable”, when discussing Selector Arguments, or “Commented-out code is an abomination”. Really Uncle Bob? Hardly anything? Abomination? You can see how this might raise the ire of an unsuspecting software developer, and human for that matter, who may stumble into this “Tip”. Well, I defended Uncle Bob and responded with the following theory. I wonder if I got close? …

Rather than angry, I think he seems Dogmatic…and by his own admission, he is.

I think his purpose is pretty clear, but moreover, he knows what DOESNT work with the software development community. Namely, an absence of strongly held principles. I think there is such weak agreement and leadership in our chosen field that anyone who proposes consistency will be looked at as angry.

It has always struck me that the examples we talk about seem so nuanced and granular. It’s easy to dismiss the example as “nit-picking”. I don’t think we should be so quick to dismiss.

So why do these examples seem so easy nit-picky? I think it’s because that’s the nature of writing code. Some things can stand the developers use of “creative license”. After all, we are creating something from NOTHING. It ALL comes from our mind. Therefore, it is an interpretation. It is indeed art.

That said, we have to force ourselves to be mindful of HOW it is done (especially in a business context). To allow our designs and implementations to emerge requires some level of consistency that ultimately makes the work easier to bend and shape. The less disciplined you are, the harder it is to react to incorrect interpretations (which happen by the hour).

If you like sports analogies, its similar to my basketball coaches when I was young telling me to keep my elbow IN when I shoot free throws. They didn’t “suggest it”. They would smack my elbow as they walked by if I wasn’t doing it! Why? Because they knew the rest of the shots I would take on the floor are affected by backspin, arch, consistency, and a good, high release. If I did it inconsistently at the free throw line, it changes my ability to “create” shots on the floor. It changes my ability to react to a fast paced environment like a basketball game.

So were my coaches being nit-picky? Or did they help teach the discipline that would allow me to create more in the long run?

My most prolific failure

I was thinking recently how much I admire people with the ability to fail. Even more so if they actually fail alot.

Why? Well, it essentially means they are TRYING. Many people who are ashamed to fail are doomed to mediocrity because they never get out there and try anything new. They don’t put their work out there to be judged. They don’t try new things. In development parlance, they never SHIP! They are safe in the cocoon of mediocrity because they are scared that someone may judge them or ridicule their work.

In my life, I endeavor to create something wonderful. I want to create art. To create. To ship!

“Real artists ship!” – Steve Jobs

To that end, I have indeed “broken some eggs”. I have had some doosies in my career, but those failures don’t prove that I’m a failure (as Seth Godin puts it) they prove that I’m an artist! They prove that I have cared enough about my life, my craft, and the lives of people I work with to try something new. To ship and expect something brilliant, even though I’m unsure of the outcome.

My inclination is to follow the advice of Godin and stop writing resumes (or using LinkedIn). There is more downside than up. But I am drawn to one last attempt to make my resume (or profile) meaningful to people who read it. I want to add my most “prolific” failure to each of my jobs and what it taught me about myself and my career.

If those failures discourage those reading it, I guarantee I wouldn’t have worked for them anyway.

Coaching vs Consulting

In a recent session with my Ironman coach, we got on the topic of how she and her husband were building their business, how coaching is a very individualized endeavor and how it doesn’t necessarily “scale”. I didn’t have much insight at the time related to her comment, but it made sense. She and her husband, both professional triathletes and coaches, only have so much time in the day after all.

This discussion got me thinking about the coaching I do in organizations. What makes me successful in my interactions with clients? Why do I prefer the coaching model over consulting (Big-6 style)?

I went home that night and had some further discussion with a friend of mine (Chris) who owns an organization that does business coaching. He had something interesting to say about the subject that proved to be very insightful. I felt like I “knew” the answer, but he made it clear to me after I bent his ear for a good hour. In fact, I say it all the time but it didn’t dawn on me until he reminded me of it. What was that wonderful insight Chris was coaching me to “discover”?

Well, most business owners (in his world), and software executives and managers in mine, need to find that emotional tie to an issue and work out the solutions on their own. If they don’t, and you GIVE them the direction they are seeking (even if you may be right) then you have failed to truly coach. Why? Because you have just put yourself in the distinct position of “owning” the outcome of your direction. If the direction works (and the first few attempts probably won’t) then you were wrong! They knew you were too good to be true!

Another likely scenario is that your direction will take some effort. Maybe it will even take multiple difficult steps. If your clients aren’t emotionally engaged in this decision, they will most likely abandon your suggestions, stop moving forward, and again you’ve lost.

Lastly, and probably worse for clients is you’re direction worked! Eureka! …What’s the problem then? Well, you have just created a dependent, complete with all the “frozen and can’t make a decision” trappings you can expect when the next issue comes along.

So what’s a better approach. As Chris puts it, “act like a coach and not like a consultant”. Get to the heart of the emotion with your clients. If the answer is obvious (to you), don’t jump directly to it without first helping lead the others toward the answer and let them discover it on their own. Their hard work and persistence will pay off and you won’t rob them of the engagement they so desperately need to make the difficult, and sometimes emotional journey to solving their own problems and thinking on their own.

Coaches do things this way because they know you have to perform when they aren’t around to help. Consultants on the other hand will happily answer all of your questions and bill you hourly when you come back to sit at their feet.