Tis not her coldness, father,
That chills my labouring breast;
It’s that confounded cucumber
I’ve ate and can’t digest.”
Richard Harris Barham (1788-1845) The Confession ‘
The Cucumber Book – Behavior-Driven Development for Testers and Developers
Are you trying to get up to speed on Business Driven Development (BDD), but are finding all the information hard to digest?
When you’re in a meeting do you wonder why everyone suddenly has a craving for cucumbers? Are you responsible for test automation and want to know how it all fits in BDD?
Do you want to know what level of detail your BDD scenarios should be written in? How does test automation fit into the Business Driven Development process?
Basic Overview of The Cucumber Book
Authors Matt Wynne and Aslak Hellesoy answer virtually every BDD question one could possibly ask in their book titled The Cucumber Book – Behavior-Driven Development for Testers and Developers.
The book’s title might lead one to believe that its contents are only for people that use the Cucumber tool for BDD with Ruby, when in fact the authors cover most of their topics in such a way that most of the principles can be applied to whichever BDD tool and programming language one is using.
Although the book is geared towards a more technical reader, the authors offer what I think are some of the best general overviews of BDD available. For example, some chapters that will be devoured by the technical and non-technical alike are:
- Why Cucumber – Chapter 1
- Gherkin Basics – Chapter 3
- Expressive Scenarios – Chapter 5
- When Cucumber Goes Bad – Chapter 6
- Adding Tests to a Legacy Application – Chapter 13
Cucumber in Three Juicy Slices
The Cucumber Book – Behavior-Driven Development for Testers and Developers is sliced into three main parts:
- Part 1 – Cucumber Fundamentals
- Part 2 – Working Example
- Part 3 – Cucumber Applied
Part One covers the basics of BDD, including:
- What is Cucumber?
- What are Features and Scenarios
- Gherkin Basics
- What are Step Definitions
- How to create expressive scenarios
- Things that can go wrong and what to look out for
My favorite chapter in Part One is Chapter Six: “When Cucumbers go bad.” The authors reveal real- world advice and workarounds for common issues they have experienced first-hand while on their consulting gigs –things like what makes a test break unintentionally, why certain features have long running times, and tips on defect prevention.
The “meat” of the book can be found in this section. All the concepts covered in Part One are actually put into practice with working examples. This is also the section in which most of the coding examples happen, so if you’re not technical you might want to skim over it.
The third and last section is basically a set of recipes that allows you to pick and choose what you wish to use based on your company’s technical stack. Topics covered are:
- Web Service Testing
- Command line Programs
I would recommend this book to anyone who is new to BDD, as well as developers who are familiar with cucumber but are looking to expand their skills. The biggest benefit for me was that after reading it I feel I have the information I need to successfully create killer automation for my next BDD project.
I also now have the know-how to avoid what the authors call a “big ball of mud” — an ironic name given to the type of software design you see when nobody has made much of an effort to actually do any software design. (In other words, it’s a big, tangled mess.)
Like I said earlier the principles learned here can be carried over to whatever tooling you use. For example I use C# with SpecFlow and got enormous benefits from reading this book.
For serious BDD practitioners this book is a must-have for your technical library. Pick it up now on Amazon and enjoy a book that’s as refreshing as fresh cucumbers drizzled with fine olive oil and a touch of freshly ground pepper on a summer day.