Lessons Learned from Richard Bach’s “Curious Lives: Adventures from the Ferret Chronicles”

I always start the new year like most people, spending quality time with friends and family, some reflection and goal setting, with good food, many cheers, and hearty laughs. I also often choose a wonderful book or two to go on an adventure with during the holidays, because it is always worth the while. This time, I got lucky finding a paperback copy of an old Richard Bach collection, titled “Curious Lives: Adventures from the Ferret Chronicles”, was glad to meet up with ferret friends, old and new both, and got valuable reminders about the courtesies and living accordingly to our highest sense of right, along with the fun ride.

Here are my favorite lines from the book:

  • Whatever harm I would do to another, I shall do first to myself. As I respect and am kind to myself, so shall I respect and be kind to peers, to elders, to kits. I claim for others the freedom to live as they wish, to think and believe as they will. I claim that freedom for myself. I shall make each choice and live each day to my highest sense of right.
  • Once, long ago, we changed our minds: end violence. In its place, no matter what: courtesy.
  • If you excel at your craft, there is a good chance that curious ferrets will need to know why, to find out what makes you different.
  • With the adventures we choose and the mysteries we solve we build our own credentials, write our own introduction to others around the world who value adventure and mystery themselves.
  • Trust. There’s a light, when we close our eyes, the light of what we want to do more than anything else in the world. Trust that light. Follow, wherever it leads.
  • Giving our visions and stories and characters to become friends to others lifts not only ourselves but the world and all its futures.
  • “There’s a time to work on a book and you know it,” said the muse. “There’s a time to think about the story, a time to care about your readers, your publisher, about rhythm and timing and grammar and spelling and punctuation, about design and advertising and publicity. But none of those times, Budgeron, is when you’re writing!”
  • Her husband had told her long ago that she didn’t need to please everyone with her stories – if a book pleases only half of one percent of the reading public, though no one else bought a single copy, it will be a massive bestseller.
  • Budgeron Ferret had chosen to be a writer. With his choice came poverty, loneliness, rejection, frustration, despair, perseverance, delight, attention, riches, love, understanding, fulfilment, a life of ideas that mattered to him, shared now and then with kings and kits.
  • How strange, he thought. Find the greatest teachers, ask the hardest questions, they never say, ‘Study philosophy’, or, ‘Get your degree’. They say, ‘You already know’.
  • The mark of true flight is not our altitude but our attitude, not our speed but our joy in the paths we find above the earth.
  • No one taught her, but she knew: more important than talent or gifts or education is the determination to make one’s wish come true.
  • “Vink, if you want to meet the one ferret who can fix any trouble, no matter how bad it is, the one who can bring you happiness when nobody else can do it – why, just look in the mirror and say hello.”

Learning How To Write Better Cucumber Scenarios

Some of the important lessons in writing automated checks are found, not in the actual implementation of the check itself, but rather in the specification. What does a green check mean? What are we really trying to find out when we’re running this check? Will somebody from another team understand why this test was written? Does this check say what’s necessary in a feature or does the check only state a procedure without context? Too often we concentrate on syntax, frameworks, and required steps in building automation, but not so much on clearly expressing what’s being checked and why the check is recorded in the first place. I’ve made that mistake and now I am trying to learn how to write better checks.

Take, for example, the cucumber checks below. Would you say that it is clear what’s being verified in the test? What would a product owner probably say about these checks when they see them for the first time?

Scenario Outline: Validating the Rate Plan Policies
  Given I am in the ShowRoomsPage for a "<hotel_type>" property from "<arrival>" to "<departure>" for a "<rateplan>" rate plan for a "confirmed" reservation
  When I view the policies for the rate plan
  Then I know that these are the correct policies
  
  Examples:
  | hotel_type | arrival         | departure       | rateplan            |
  | DWH        | 4 DAYS FROM NOW | 6 DAYS FROM NOW | Public_Partial_LT   |
  | DWH        | TOMORROW        | 3 DAYS FROM NOW | Public_Full_YesR_LT |

Some of the questions that would probably pop up in their minds include the following: How are the examples in the grid necessary for the test? What does Public_Partial_LT or Public_Full_YesR_LT mean? Do we really need to know the arrival and departure date settings for the checks? What does the Given statement mean? Most importantly, how do I know that the policies are actually correct for these tests?

This was how I wrote my checks before when I started studying how to write Cucumber-Watir-Ruby checks. And a lot of my checks in the existing test suite still are. I am, however, trying to learn how to re-write them in a better way, in terms of readability and conciseness, guided by lessons so far learned from Jeff Nyman’s test description language blog posts, so that almost everybody in our team can recognize in a glance what a particular check does and why they are included in the feature.

Re-writing the example checks above, I now have these:

Scenario: ShowRooms Prepayment Policy, DWH Partial
  When guest views the policies for a DWH property for a partial rate plan
  Then a copy of "Only 10% prepayment is required to confirm your reservation" is displayed in the prepayment policy

Scenario: ShowRooms Prepayment Policy, DWH Full Non-Refundable
  When guest views the policies for a DWH property for a full nonrefundable rate plan
  Then a copy of "Full prepayment is required to confirm your reservation" is displayed in the prepayment policy

Not perfect, but I’d like to think that they are more effective than the ones I had before. Checks are more specific, unrelated information are not included in the test, and we understand what it means when the checks pass or fail.

What do you think?

Fifty-Two Tuesdays Since, Thank You

It has been fifty-two Tuesdays since I first started writing for One Software Tester. Writing that initial post, it was the first week of March last year, I remember having doubts about whether I can continuously publish small pieces that somehow makes sense about the world of software testing in a weekly basis. Consistently conjuring honest and worthwhile notes about the industry one Tuesday after another posed a bold challenge for me, especially because I am not really a prolific writer.

But here I am, in my fourth year working in the software testing industry and in my first year writing about it. I feel ecstatic, first years are always memorable milestones albeit small, and I would like to give all my heartfelt thank yous to everyone who have passed by and was curious, especially to those who have chosen to be dear Readers by following. ❤ I promise to continue the Tuesday written broadcasts, plus some cool takeaways for each one in the mailing list some time in the near future.

In the meantime, go make something remarkable and give someone you deeply care for a lovely hug today. 🙂