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
| Aspect | TDD | BDD |
|---|---|---|
| Focus | Technical implementation | Business behavior |
| Written by | Developers | Everyone (BA, QA, Dev) |
| Language | Code (assertions) | Plain English (Gherkin) |
| Test style | assertEquals(200, status) | Then the status should be 200 |
| Documentation | In code | In feature files |
BDD Cycle
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
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
| Tool | Language |
|---|---|
| Cucumber | Java, JS, Ruby |
| SpecFlow | C# / .NET |
| Behave | Python |
| JBehave | Java |
| Behat | PHP |
