Most of us should have heard about the term BDD - Behavious Driven Development. In this post, I would like to give some intro about familiar BDD framework called Cucumber and why we need BDD.
Why BDD?
Once people started moving to Test Driven Development (TDD), it helped a lot interms of reducing the bugs in development stage itself as every feature was developed by creating smaller unit tests, making it FAIL and coding the functionalities to make it PASS.
But eventually, the BAs and testers are not able to follow these testing practices and thus gap in communication which lead to lot of mis-understanding the features/requirements.
So, experts wanted a framework which should take inputs like normal people speaking English and should run the tests based on those requirement. Also this requirement will support as documentation of features to understand by testers/BAs/devs. Thus BDD was born.
BDD keywords:
Given, When, Then and And
Example:
Scenario: Login to Facebook
Given Facebook login page
When I enter valid username and passowrd
Then I should see my home page
And I should see my name
If you see above scenario, this will act as requirement as well as documentation. We are using this feature scenarios and connecting each steps to our own selenium steps written in java or any other language and running it.
To understand the .feature files and options that we can use for different way of execution, control, etc., read this documentation.
https://cucumber.io/docs/reference
You can find the sample project and start learning on your own.
https://github.com/SCSVEL/SampleCucumber-FB
Why BDD?
Once people started moving to Test Driven Development (TDD), it helped a lot interms of reducing the bugs in development stage itself as every feature was developed by creating smaller unit tests, making it FAIL and coding the functionalities to make it PASS.
But eventually, the BAs and testers are not able to follow these testing practices and thus gap in communication which lead to lot of mis-understanding the features/requirements.
So, experts wanted a framework which should take inputs like normal people speaking English and should run the tests based on those requirement. Also this requirement will support as documentation of features to understand by testers/BAs/devs. Thus BDD was born.
BDD keywords:
Given, When, Then and And
Example:
Scenario: Login to Facebook
Given Facebook login page
When I enter valid username and passowrd
Then I should see my home page
And I should see my name
If you see above scenario, this will act as requirement as well as documentation. We are using this feature scenarios and connecting each steps to our own selenium steps written in java or any other language and running it.
To understand the .feature files and options that we can use for different way of execution, control, etc., read this documentation.
https://cucumber.io/docs/reference
You can find the sample project and start learning on your own.
https://github.com/SCSVEL/SampleCucumber-FB
Nice information
ReplyDeletedata science training in Marathahalli
best data science courses in Marathahalli
data science institute in Marathahalli
data science certification Marathahalli
data analytics training in Marathahalli
data science training institute in Marathahalli
It was a very good experience,Faculty members are very knowledgeable and cooperative. Specially My trainer teaching more as he focused upon practical rather than theory. All together it was an enlightening and informative course.
ReplyDeletesoftware testing training institutes in bangalore
software testing training in bangalore
best software testing training institutes in bangalore
software testing training course content
software testing training interview questions
software testing training & placement in bangalore
software testing training center in bangalore