</>

Technology

Cucumber

Difficulty

Beginner

Interview Question

What is the purpose of the BDD (Behaviour Driven Development) methodology?

Answer

Behaviour Driven Development (BDD)

Definition

BDD is a software development methodology where tests are written in plain, human-readable language that describes the behavior of an application from a business perspective. It extends TDD (Test Driven Development) by making tests understandable to non-programmers.

Core Purpose

The main aim of BDD is to make project roles — Business Analysts, Quality Assurance, Developers, and Support Teams — understand the application behavior without diving deep into technical aspects.

TDD vs BDD

AspectTDDBDD
FocusTechnical implementationBusiness behavior
Written byDevelopersEveryone (BA, QA, Dev)
LanguageCode (assertions)Plain English (Gherkin)
Test styleassertEquals(200, status)Then the status should be 200
DocumentationIn codeIn feature files

BDD Cycle

CODE
1. BA/PO writes user story
          ↓
2. Team writes Gherkin scenarios (Given/When/Then)
          ↓
3. Dev writes code to make scenario pass (RED → GREEN)
          ↓
4. QA automates the scenario with Cucumber + Selenium
          ↓
5. Feature file becomes living documentation

Benefits in Real World

CODE
Without BDD:
  BA writes requirements in Word docs
  → Dev interprets differently
  → QA tests different things
  → Rework + bugs in production

With BDD:
  BA writes feature files in Gherkin
  → Dev implements to make scenarios pass
  → QA verifies same scenarios are automated
  → All three are aligned from day one

BDD Tools

ToolLanguage
CucumberJava, JS, Ruby
SpecFlowC# / .NET
BehavePython
JBehaveJava
BehatPHP

Follow AutomateQA

Related Topics