Behavior-driven testing
We have now learned how to supplement unit tests with integration tests, increasing the scope of our component under test. End-to-end tests have the most scope as they test the entirety of our system. They are often discussed together with behavior-driven design (BDD), which is a branch of TDD that focuses on writing human-readable tests based on user requirements.
Fundamentals of BDD
The first step of BDD practitioners is to establish a shared vocabulary between the different interested parties: business stakeholders, domain experts, and various other engineering functions.
Based on this shared and well-understood vocabulary, the user requirements are then converted into user acceptance tests (UATs). These tests are end-to-end tests that ensure that system requirements are covered by all new releases.
Tests are usually written in the Given-When-Then structure, using business language and the shared vocabulary previously established by the business...