Behavior-Driven Development (BDD)
BDD conforms to the rules of TDD we already described but focuses mainly on business value and client-side behavior.
We discussed that the strength of unit tests is as follows: “It is very unlikely that when describing a behavior in two completely different ways, that is, with code and with examples, we might make exactly the same errors, so errors are discovered with a probability that is close to 100%.”
BDD uses the same approach, but the examples used in TDD must not depend on the specific way the functionality might be implemented. That is, examples must be as close as possible to pure specifications. This way, we are sure tests can’t influence the way functionality is implemented and vice versa; we are not influenced by pure technical facilities or constraints when writing specifications but focus mainly on the user needs.
Moreover, tests should use a vocabulary that can be understood by stakeholders. For these...