Sharpen Your Knives

Sharpen Your Knives

You’ve heard the old adage about the lumberjack who—in order to cut a tree in an hour—will take 45 minutes to sharpen the saw? This old analogy really needs updating: Not many of us are all that familiar with the logging industry.

I like to instead use the metaphor of the chef who sharpens her knives before cooking.

Exceptional Circumstances by Rob Meyers

Exceptional Circumstances by Rob Meyers

In our Business Driven Development (BDD) course, we use a real example of an online library patron portal. Course participants are provided with a number of (often vague) business rules regarding whether or not a book loan can be renewed. Some have to do with the state of the book (e.g., has another patron requested a “hold” on the book?) and others on the loan, itself (e.g., has this patron already renewed twice?).

The business rules shape the Gherkin scenarios, to be sure, but that’s not what I want to talk about today. After the scenarios, step definitions, and glue code are all written, it came down to writing the implementation, and one course participant brought up an excellent question.

“If the book isn’t renewable, should I throw an exception?”