Behavior Driven Development (BDD) is an extension of test-driven development (TDD) which emphasizes on writing the test first based on the system’s behavior. It encourages a
collaborative approach from Developers, QAs and end users. Successful BDD requires clear communication and understanding of the user requirements, behaviors and acceptance criteria from the business side in an understandable language passed to the technical deliveries. This way, acceptance tests are built over time and then passes on to test teams for automation.
An example of Given-When-Then approach in simple English and Gherkin language in a BDD,
Given: When the user has valid user credentials (Username & Password)
When: When the user clicks on the login button
Then: Display successful validation message
BDD testing follow the process, State behavior scenarios > write tests > Run tests and fail > write code to pass > Pass test and refactor.
Cucumber is the widely used BDD testing tool for its ability to define system/applications behavior in plain English like language (Gherkin)