×
IBORN Logo
Three people collaborating at a table, focused on a laptop.

BDD + Cucumber - The best of both worlds

Save Isirova
February 18, 2019


I sense you might have questions as the title follows: “What has BDD as a development methodology has to do with testing techniques?”, “The name of the methodology has nothing related to testing, so how can it be used for that purpose?”, “How can you connect a concept like this with the Cucumber testing framework?” and so on.

BDD (Behavior Driven Development) originates from a technique called Test Driven Development (TDD) but is more advanced when it comes to development processes. As TDD states “the tests should be written before any functionality is implemented”, BDD adds “the behavioral nature and business flow of the tests should be established before they are created”.

With BDD, you’re building up an accumulation of acceptance tests driven by business value, which leads to structured automated tests that describe the behavior of the user in the system.

But how will you know that your development is behavior driven? In my experience, that has been the most tricky part because there are various parameters and if you lack some of them you will probably struggle and not know whether you are on the right path. Often the behavior that is most important to the user it is not so obvious to the developers.

That’s when BDD conceptualization kicks in! I consider this phase as taking the QA hat off and putting the user hat on. Once you’ve specified the user needs, you put the QA hat back on and implement your specification.

When it comes to implementation, we are talking about having all specified, documented and automated in one place. To have the best of both worlds, we will need some sort of “connector” to bring the little pieces of the puzzle together, as well as an “activator” in order for the idea to be a success! Make room for Cucumber!! Such a powerful tool enables writing tests in Gherkin language, uses APIs and libraries that are available and standardized for the technology used. I applaud the idea of writing tests that are understandable for both technical and non-technical people in terms of features and scenarios that explain it further.

Illustration of the steps included in the BDD mission.

So, we already have the tool that understands Gherkins and then we have the execution in place. The framework depends on the technology and purposes you have in mind. You can think of the testing framework as that one friend that is always here to help and make things better. The goal of the framework is to provide a tool with different facilities to achieve the result.

Seems promising, doesn’t it? Especially when it comes to End-to-end (e2e) tests. As a category of tests, we want to implement in order to test the flow or the behavior of the system from a realistic end-user point of view, we want to include two more parties. My experience with Angular applications put Protractor and Cucumber-Protractor frameworks in the way of achieving this.

First things first, make sure you have the following installations in place:

1. Environmental installations:

  • JDK environment

  • NodeJS

  • Visual Studio Code editor

  • (Chrome)Driver.exe

2. NPM packages:

  • cucumber

  • protractor

  • protractor-cucumber-framework

  • selenium-webdriver

3. Extensions:

  • Cucumber(Gherkin)

Creating the feature file along with one functional scenario should have the final look such as the one shown on the picture below.

Code representation of the test scenario with Gherkin syntax.


If you think that this article was useful and you’ve learned from it, but you are always up for more knowledge on the subject, check out the other blog entries here at IBORN , there might be another one or two right up your alley.

More similar blog posts:

Three people collaborating at a table, focused on a laptop.
How feature flags benefit various roles in teams

Everything you need to know about feature flags. Explore how this simple yet transformative tool enhances agility, quality, and collaboration across diverse roles in a team. 

Three people collaborating at a table, focused on a laptop.
Creating Customer Value with Quality Assurance

From an eminently commercial point of view, creating value means offering something to someone who wants to fulfill a need and hopes to satisfy it by making some kind of sacrifice - usually economic.

Three people collaborating at a table, focused on a laptop.
Benefits of making software quality assurance tests

Isn’t it frustrating when the software you are using suddenly stops working? If a website or an app takes more than 3 seconds to load, we close it immediately. Let's be honest, we live in a time when nobody has patience with poor quality software.

Three people collaborating at a table, focused on a laptop.
Deliver the right software with SBE

If you work with software development I’m sure that you’ve already heard words like BDD, TDD, ATDD, etc. But, have you heard about SBE? SBE or Specification by Example is a collaborative method for specifying requirements and test.

Three people collaborating at a table, focused on a laptop.
9 myths about QA and testing

Do you know the real functions of a QA? Do you know the main difference between QA and Tester? Are they heroes or villains? Let’s go through the most common myths regarding the process of testing and try to debunk them.

Three people collaborating at a table, focused on a laptop.
Quality Assurance vs. Tester - What is the difference?

Testing is an activity. Anybody can test. Sometimes testing is just using a product, while QA requires a strategic approach to testing in the sense of planning how, what, and when to test. Let's deep dive into what is the main difference between quality assurance and testing.