Behaviour Driven Development (BDD)

QA Talks Community
2 min readMar 16, 2022

--

BDD Architecture:

BDD Framework consists of three components

•Feature File

•Step Definition

•Runner Class

Feature File Component

•Given

•When

•Then

•And

•As

•But

•Scenario

•Scenario Outline

•Scenario Template

•Examples

Step Definition Component

•Java Code +Annotations

Runner Class Component

•Runner Class with Junit/TestNG

What is BDD?

•Behavioral Driven Development (BDD) is a software development approach that has evolved from TDD (Test Driven Development).

•It differs by being written in a shared language, which improves communication between tech and non-tech teams and stakeholders.

•In both development approaches, tests are written ahead of the code, but in BDD, tests are more user-focused and based on the system’s behavior

Why BDD?

  • TDD works satisfactorily, as long as the business owner is familiar with the unit test framework being used and their technical skills are strong enough, which is not always the case.
  • In these circumstances, BDD has the advantage because the test cases can be written in a common language used by the stakeholders such as for example, English.
  • This access to clearer, low-jargon communication is probably the biggest advantage to using BDD, making it possible for collaboration between the technical and non-technical teams to run with improved efficiency.

Advantages of BDD

•You are no longer defining ‘test’, but are defining ‘behavior’.

•Better communication between developers, testers, and product owners.

•Because BDD is explained using simple language, the learning curve will be much shorter.

•Being non-technical in nature, it can reach a wider audience.

•The behavioral approach defines acceptance criteria prior to development.

Disadvantages of BDD

•To work in BDD, prior experience of TDD is required.

•BDD is incompatible with the waterfall approach.

•If the requirements are not properly specified, BDD may not be effective.

•Testers using BDD need to have sufficient technical skills.

Gherkin keywords

•Each line that isn’t a blank line has to start with a Gherkin keyword, followed by any text you like.

•The only exceptions are the feature and scenario descriptions.

Primary Keywords:

•Feature

•Example (or Scenario)

•Given, When, Then, And, But for steps (or *)

•Background

•Scenario Outline (or Scenario Template)

•Examples (or Scenarios)

Secondary Keywords:

•””” (Doc Strings)

•| (Data Tables)

•@ (Tags)

  • # (Comments)

Author:

Codeless Conf 2022: Register below

Blogger of the month program: Register below

--

--

QA Talks Community
QA Talks Community

Written by QA Talks Community

Welcome to QA Talks, a community-based startup that's mainly focused on QA blogs & talks — https://www.tech-talks.info/

No responses yet