QAAnywhere

Remote QA & testing jobs, worldwide.

Guides

BDD with Cucumber and Reqnroll: useful conversations, readable tests

By Denis Bojkovski, Test Automation Architect · Published November 25, 2026

Two things with one name

Behaviour-driven development is a way of agreeing on behaviour through examples before building. Gherkin, with its Given, When and Then, is a format for recording them. Many teams adopt the format and skip the conversation, and then maintain an extra layer for nothing.

BDD, Cucumber or SpecFlow appeared in 7 of the 86 full descriptions on QAAnywhere on 25 November 2026. For .NET, note that SpecFlow reached end of life at the end of 2024; Reqnroll is the community continuation, and the usual successor.

The conversation

A developer, a tester and a product person take one story and spend 25 minutes on rules and examples:

  • Rule: refunds are allowed within 30 days of delivery.
  • Example: delivered 1 March, requested 31 March: allowed.
  • Example: requested 1 April: refused.
  • Question: does the day of delivery count?

Unanswered questions are the result you came for. If there are too many, the story is not ready.

Scenarios people can read

Feature: Refunds

  Rule: A refund can be requested within 30 days of delivery

    Scenario Outline: Refund window
      Given an order delivered on <delivered>
      When the customer requests a refund on <requested>
      Then the refund is <result>

      Examples:
        | delivered  | requested  | result   |
        | 2026-03-01 | 2026-03-31 | accepted |
        | 2026-03-01 | 2026-04-01 | refused  |

There are no buttons, no selectors and no login. Compare a script disguised as a scenario:

When I click "#refund" And I type "broken" in "reason" And I press "OK"

The second changes whenever the screen does, and tells a product owner nothing.

Steps in C#

[Binding]
public sealed class RefundSteps(RefundPolicy policy)
{
    private DateOnly delivered;
    private bool accepted;

    [Given(@"an order delivered on (.*)")]
    public void GivenDelivered(string date) => delivered = DateOnly.Parse(date);

    [When(@"the customer requests a refund on (.*)")]
    public void WhenRequested(string date) =>
        accepted = policy.Allows(delivered, DateOnly.Parse(date));

    [Then(@"the refund is (accepted|refused)")]
    public void ThenResult(string result) =>
        Assert.That(accepted, Is.EqualTo(result == "accepted"));
}

The step calls the policy directly. Scenarios do not have to go through a browser; the rule is checked where it lives, in milliseconds.

Keep steps manageable

  • Use business words, and one phrase for each idea.
  • Keep logic out of step definitions; delegate to the same helpers other tests use.
  • Share state through injected context, not static fields.
  • Remove unused steps; the tools can list them.
  • Prefer a few scenarios per rule, with most combinations in unit tests.

When not to use it

  • Nobody outside engineering reads the scenarios.
  • Scenarios are written after the code, by testers alone.
  • The purpose is for non-programmers to write automation. They will write steps that a programmer must implement anyway.
  • Technical checks: retries, caching, parsing. Plain tests are clearer.

Ask the product owner to open a feature file. If they never have, the format is costing more than it gives. You can keep the conversation and write ordinary tests with good names.

In an interview

Explain the conversation first, then the format, and then one case where you would not use it. Being able to rewrite a click-by-click scenario into a rule is a common exercise; practise on the example above. Related: test case design techniques.

Open remote QA roles that use Cucumber

  1. QA EngineerSupplyHouse.com · Remote, Remote, India
  2. QA Automation EngineerValtech · India - Remote

More guides