DEV Community

Íris Xavier
Íris Xavier

Posted on

4 Steps for a good BDD

First of all, we need to keep in mind that BDD (Behavior Driven Development) is a form of agile software development and that the main objective of BDD is to establish an easy way to communicate the idea to other people. Developers, testers, investors and customers
can understand and discuss software requirements, to create a clearer test and validations to obtainan a good product/service with fewer defects.

The structure of BDD is:

Scenario: a title of your requirements;
Given: the state of the system that will receive the behavior/action;
When: the behavior/action that happens and causes the result in the end;
Then: the result caused by the behavior in the state;

"Ok" - you may think -"so... there's no error in this methodology". Well... not yet. If you are too simple or too detalist you take the risk of not reaching the right point of your issue.
"And how do I reach the central point of my cases?". Well, I got these steps:

Step01 : A good Scenario 🖼

Try to create accessible scenario. Paying attention to the most recurring situations and requirements is a good way to guarantee the integrity and quality of your software. Create scenarios that are easily identified as "Success" and "Failure" because this will help the user to see through the objective.

Step02: a simple comand has a simple response ⚖️

To execute a scenario, lowering the complexity of the action makes the test more comprehensible and helps the person behind the test o understand the response a little better.

Step03: don't be too much ❌

In addition to avoiding creating very simple or very complex test cases, it is important to create test cases that are recurring. Always prioritize the main actions of your software to guarantee the delivery of the main functions. With the main functions tested, you will be able to spend more time with less recurring actions.

Step04: let the answer guide the way 🗺️

Before all these steps, make sure that the anwsers will make sense with your main objective. Collecting and analyzing responses are points of important attention as these are the ways that will inform your team if the final product needs to evolve and where it needs to evolve.

Well, that's it guys.

USEFULL LINKS:
https://circleci.com/blog/how-to-test-software-part-ii-tdd-and-bdd/?utm_medium=SEM&utm_source=gnb&utm_campaign=SEM-gnb-DSA-Eng-ni&utm_content=&utm_term=dynamicSearch-&gclid=CjwKCAjwztL2BRATEiwAvnALcufZo2ZsjCzFbXlep4lpUT_8cLBrdZlzggwsfgbdYLyL0u0JT-b70RoCIGwQAvD_BwE

Top comments (0)