Can we use analytics cookies? They count visits and form use. We run no ads.

AQA Virtual Summit/MeetupsTest Automation Tools

Nikolaj Tolkačiov – Don’t hate the cucumber, hate the salad

Published 11 May 2022. Updated with a short answer, key takeaways and a FAQ; the talk text is unchanged. Published by Zapple.Tech, founded by the founders of CodeceptJS and Codeception, open-source testing frameworks.

Watch on YouTube
Short answer

In this talk, Nikolaj Tolkaciov, head of testing practice at Devbridge, shares his experience with calaba.sh, SpecFlow, Protractor and Cucumber, and why his team chose Cucumber. He reports figures from three years of use, such as 53 step definitions covering 12,579 steps, and the overhead of Gherkin.

Key takeaways
  • Why some testers react negatively to Cucumber
  • Experience with calaba.sh, SpecFlow and Protractor
  • Keeping step options low for reuse
  • Three years of figures on steps and step definitions
  • Gherkin versus non-Gherkin automation

At the February Test Automation Meetup, Nikolaj Tolkaciov, head of Devbridge’s testing practice, talked about his experience with different test automation frameworks, the reasons for choosing Cucumber, and the results.

Cucumber is a testing framework where you can create scripts for automated tests. Some testers react exceptionally negatively to Cucumber. What they don’t like is this. It was promised that to switch to automated testing in Cucumber, you can simply copy and paste the old manual test cases, and everything should magically work. But this did not happen; expectations did not coincide with reality.As for the private opinion of Nikolaj Tolkaciov, Cucumber is a regular framework with its own advantages and disadvantages. His experience as a QA engineer includes experience with calaba.sh, SpecFlow and Protractor.

Alternatives to Cucumber

Calaba.sh has been used to automate mobile app testing. It connected to Apple and Android test devices, which allowed feedback on the quality of testing performance.The downside of using SpecFlow was different steps for different situations, up to 20 options for the same action. Each time you write a function file, it is not known in advance whether the chosen option will work. Also, in SpecFlow, it is problematic to reuse tests each time you need to write a new one.Protractor is a BDD framework used for AngularJS apps, similar in functionality to Cucumber. And if, after some time using business intelligence, project managers and designers abandoned the use of BDD and returned to simple requirements, testers decided to continue using this approach.

Experience with Cucumber

The main goal of using this framework is to achieve maximum reusability. It is essential to keep the number of step options as low as possible so that testers always know which step is next and be sure that it will work.Nikolai’s team was able to achieve the following:

  • Feature step writing became easier as there are fewer step definitions you can cheese from.
  • Lower maintenance.
  • Step definitions became more flexible.

Speaking about whether this framework justified itself for 3 years of its active use, it is worth paying attention to the statistics:

  • Total Step count: 12579 (+1811 including examples) in scripts.
  • Total step definition count: 53.
  • Average: 237(271) steps/step definition. If you have 53 step definitions, they will be used in 237 different places (buttons, drop-down lists, fields, etc.).
  • Median ~ 500 steps/step definition. 10 of the 53 step definitions are still used once or twice, so the actual median will be about 500 steps/step definition.

For comparison, there were 3500 steps and 175 step definitions in the previous implementation of the specification flow. That’s four times the number of steps for the same number of scenarios. Accordingly, working with such a set of characteristics is 16 times more complex – in maintenance, determining the steps for work, and refactoring big data, such as the codebase. On average, each scenario was used only 19 times.

Summary

If we compare Gherkin and non-Gherkin approaches, non-Gherkin automation will be somewhat linear, i.e., complexity will increase over time, but this will not be a problem. In the case of Gherkin automation, there is some overhead. Sometimes this is a minus when you run into bottlenecks or function files. Because if you already have a step definition and it’s already in use, and you want to create a new one, you might be locked out. In such a situation, you will have to come up with something creative to add a new step definition.

Questions about this talk

Why do some testers dislike Cucumber?

Nikolaj Tolkaciov says Cucumber was promised to work by copying and pasting old manual test cases, and that this did not happen: expectations did not match reality. In his view, Cucumber is a regular framework with its own advantages and disadvantages.

What results did Nikolaj Tolkaciov's team get from Cucumber?

His team found that writing feature steps became easier with fewer step definitions to choose from, maintenance dropped and step definitions became more flexible. After three years, they had 12,579 steps and 53 step definitions, against 3,500 steps and 175 step definitions in the previous SpecFlow implementation.

What are the drawbacks of Gherkin automation?

Nikolaj Tolkaciov says Gherkin automation has some overhead. If a step definition already exists and is in use, creating a new one can be blocked, and you have to come up with something creative. Non-Gherkin automation grows more linearly in complexity, he says.

Request a QA audit quote

Tell us what you ship and what worries you.

What happens after you send this

  1. You send the form: your situation and what you need tested, then your name and work email.
  2. Within one business day, we reply with a suggested first step, its scope, timeline and a quote.
  • Fixed scope
  • You decide after each step
  • The tests live in your repository
  • An NDA signed before access

“They helped us to close the positions and consult our team how to proceed further. High-quality quick feedbacks with the deep checking of the required tasks, professional approach, great understanding of the company's technologies and product, detailed reports.”

Kristina Lavrentieva, Manager at keepgo.com, Israel
  • Rated 4.9 out of 5 on Clutch, from 7 client reviews
  • 42 completed test automation and infrastructure projects
  • Founded by the founders of CodeceptJS and Codeception, open-source testing frameworks

Request a QA audit quote

    What is closest to your situation?
    Optional. The product, the platforms, how often you release, what broke last.

    You decide after our reply whether to go ahead.

    Prefer to talk first? Book a call

    One-week QA audit · written report

    Request a QA audit quote