DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Quick Review of The Cucumber Book from a SpecFlow Perspective

Quick Review of The Cucumber Book from a SpecFlow Perspective

Dennis Doomen user avatar by
Dennis Doomen
·
Feb. 21, 13 · Interview
Like (0)
Save
Tweet
Share
4.07K Views

Join the DZone community and get the full member experience.

Join For Free

Recently I finished reading a new book titled The Cucumber Book: Behaviour-Driven Development for Testers and Developers by Matt Wynne and Aslak Hellesoy. Aslak is the founder of the Cucumber project (which is what SpecFlow for .NET is based on), and Matt is one of its most active developers. The 328-page book is only 20 USD if you get it through The Pragmatic Bookshelf and worth the money, even if you're an experienced SpecFlow developer/tester. 


clip_image001

The code examples are written in Ruby, but even without any prior knowledge of Ruby, I managed to get through them quite easily. (Off-topic: It's not a language I see myself coding in anytime soon, so I must be a C-language addict). 

Anyway, the first 6 chapters (Part I) are awesome. Not only do they provide a decent introduction to the concepts behind Cucumber and a detailed break down of the Gherkin language, it also provides numerous tips and tricks that should prevent you from making your efforts gone bad. Just as you can go bad with practices like TDD, there's a whole lot you can do wrong when dealing with automation scenarios based on the Gherkin language. Even after reading the Secret Ninja Cucumber Scrolls and everything there is to read on SpecFlow, I learned some valuable new lessons that sure are going to improve the work I'm doing right now. 

Chapters 7-10 (Part II) are taking a deep-dive in implementing the Step Definitions using Ruby. Since I don't care about the Ruby details, I mostly browsed through these pages looking for hidden tips and tricks. If you are a .NET developer like me, I would do the same. But just make sure you read all the side-notes (the ones with a bluish background). They contain some valuable best practices. 

Again, if you're a .NET developers, you can skip chapters 11, 14 to 16 and the appendixes since they are too specific to the Cucumber tool and the Ruby language. But do try to read chapters 12 (Testing a REST Service) and 13 (Adding Tests to a Legacy Application).

You might wonder why I still believe the 20 dollars are worth the money after I told you to skip so much of the book's contents. It just that those first 100 pages plus the many best practices in the remainder of it really make up for the rest of the book. Since I'll be talking about SpecFlow and WaTiN at the Dutch .NET User Group meeting on August 30st, I have been looking for some decent advice on writing proper Features and Scenarios for a while. The book delivered. Period. 
For completeness, here’s the table of the contents. 
  1. Why Cucumber?
  2. First Taste
  3. Gherkin Basics
  4. Step Definitions: From the Outside
  5. Expressive Scenarios
  6. When Cucumbers Go Bad
  7. Step Definitions: On the Inside
  8. Support Code
  9. Dealing with Message Queues and Asynchronous Components
  10. Databases
  11. The Cucumber Command-Line Interface
  12. Testing a REST Web Service
  13. Adding Tests to a Legacy Application
  14. Bootstrapping Rails
  15. Using Capybara to Test Ajax Web Applications
  16. Testing Command Line Applications with Aruba
Cucumber (software) Book

Published at DZone with permission of Dennis Doomen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Factors When Selecting a Database
  • Iptables Basic Commands for Novice
  • OpenID Connect Flows
  • Understanding gRPC Concepts, Use Cases, and Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: