Kiandra Insights

Behaviour-Driven Development - Cucumber

Harini Rajanna
by
Harini Rajanna
Quality Analyst
|
July 5, 2019
Harini Rajanna
Quality Analyst
July 5, 2019
Dark screen full of colourful code

Behaviour-Driven Development (BDD) is an agile software development technique which helps to build functionality incrementally as per its expected behaviour. Basically, it’s a set of practices that aim to reduce common wasteful activities in software development.

BDD testing is an extension of Test-driven development (TDD). Like in TDD, BDD tests are written before writing and adding application code. The major difference that we get to see here are:

•  Tests are written in plain descriptive English type grammar
•  Tests are explained as behaviour of application and are more user focused
•  Using examples to clarify requirements.

Advantages of BDD

Inclusion: BDD is meant to be collaborative. Everyone from the customer to the tester should be able to easily engage in product development. And anyone can write behaviour scenarios because they are written in plain language
Clarity: Scenarios focus on the expected behaviours of the product.
Automation: BDD frameworks make it easy to turn scenarios into automated test
Test-Driven: BDD is an evolution of TDD
Adaptability: BDD scenarios are easy to update as the product changes. Plain language is easy to edit. Modular design makes changes to automation code safe

There are various tools which support BDD like Cucumber, JBehave, SpecFlow etc. Here we are going to focus on Cucumber.

Cucumber is a free open source BDD tool originally written in Ruby programming language that runs automated tests. It keeps specifications, automated test scripts, and documentation in the same place. For a complex project, a team first writes the examples and then runs them in Cucumber.

Cucumber further tells you which ones are working, and which ones aren’t. It lets you define application behaviour in plain descriptive/meaningful English text using a simple grammar defined by a language called Gherkin. It can be used to “test” the code written in other languages like Java, Ruby etc.

Main Features

• Writing BDD tests in an omnipresent language, a language structured around the domain model and widely used by all team members comprising of developers, testers, BAs, and customers
• Connecting technical with nontechnical members of a software team
• It allows direct interaction with the developer’s code, but BDD tests are written in a language which can also be made out by business stakeholders
• Finally, acceptance tests can be executed automatically, while it is performed manually by business stakeholders.

Keywords used in Cucumber tests:

Gherkin-Keywords-(1).jpg

An example of a Cucumber test is:

test-(1).png
Share article
LinkedIn.com

More insights

Aerial view of a cargo port at night showing a large container ship being loaded or unloaded by cranes. The scene is illuminated with industrial lighting and features overlay graphics of connected white dots and curved lines, representing a digital or AI-powered logistics network.

Rethinking logistics with AI: real challenges with real solutions

Cassandra Wallace
2/7/2025

In transport and logistics, most operators don’t need to be sold on the benefits of AI, they just need a clear path to making it work. This blog post outlines the most common challenges we see across logistics businesses, and how AI, when implemented correctly, can solve them and improve performance.

Read more
An illustrated person holding a tablet, looking up at a large, abstract AI brain filled with interconnected circuits and nodes, symbolising the integration of technology and human thinking.

AI and the human factor: what I’ve learned leading a team through change

Aarti Nagpal
26/6/2025

As a Software Delivery Team Lead, I’ve experienced firsthand how our strength lies in pairing deep technical expertise with a culture that genuinely values people. We’re not here to chase hype. We’re here to build things that matter, with teams that are empowered, curious, and supported.

Read more
A stylised digital padlock glowing in neon colours, symbolising cybersecurity and data protection. The background features abstract data panels and glowing lines, representing a secure digital infrastructure.

Personal data in government systems isn’t just sensitive, it’s sacred.

David Velasquez
25/6/2025

When you’re delivering software for government, there are no shortcuts. Security isn’t a feature. It’s a non-negotiable. At Kiandra, we work with government departments where privacy, compliance, and performance must co-exist – from health records to social services.

Read more

Let’s discuss your next project

Whether you’re curious about custom software or have a specific problem to solve – we’re here to answer your questions. Fill in the following form, and we’ll be in touch soon.

Email

Would you like to receive an occasional email showcasing the latest insights, articles and news from our team of software experts?

Thanks for reaching out! One of our software experts will be in
touch soon to help you with your enquiry
Oops! Something went wrong while submitting the form.

This website uses cookies to improve your experience. By browsing our website you consent to the use of cookies as detailed in our Privacy Policy