What is Behaviour-Driven Development (BDD)?
Quick Answer
BDD describes behaviour in a structured natural language (Gherkin: Given… When… Then…) that both business and developers can read, and each scenario is backed by executable step definitions. It's TDD framed around business outcomes and shared understanding, giving you “living documentation”.
BDD is about writing the expected behaviour in Given-When-Then scenarios that a non-developer can read, and then wiring each line up to code that actually exercises the system. So the feature file is both the spec and an automated test, and it stays honest because it runs. The real benefit is the conversation — the team agrees on the scenarios before anyone writes code. In .NET that's SpecFlow, now Reqnroll. If it's only developers reading the scenarios, though, the Gherkin layer is just overhead and well-named xUnit tests do the job.
- Feature files describe scenarios; step definitions (in C#) map each line to code that drives the system.
- .NET tools: SpecFlow (now Reqnroll).
- Value: aligns devs, testers and product on what “done” means before coding; the scenarios stay accurate because they run.
- Cost: the extra Gherkin layer is overhead if only developers ever read it — then plain xUnit with good names is simpler.