BDD — Behavior driven development with Spring boot

Shaila Nasrin
2 min readApr 22, 2024

There are three main component of BDD:

  • Discovery
  • Formulation
  • Automation

Discovery

In this phase we have to discuss with the product owner and stakeholders about the project and what features it would have and document those.

Formulation

In this phase you already know the problem you are solving and features you are supposed to implement. Now, you have to discuss among the team team member about specific scenarios and outcomes of the senecios with examples according to users perspective. And document it in a way where everyone is aware of and on the same page about how each features supposed to work.

Automation

In this phase a tool is used to convert the scenarios which were defined in Formulation phase into test. There are many different tools which you can use to do it but I have used a tool named Cucumber, so in this post I will explain how to use it in your spring boot project.

Cucumber

Cucumber is a testing framework that helps you implement BDD in your project

Add Cucumber dependencies in pom.xml

--

--