What is BDD and how is it different from TDD?
Answer 1, authority 100%
BDD – behavior-driven development – is behavior-driven development. That is, there is a special person (or people) who writes descriptions like “I, as a user, want when clicked the start button then the menu was shown as in the picture”. (there are specially highlighted keywords). Programmers have long written special tools (for example, cucumber ) that translate such descriptions into tests (sometimes completely transparent to the programmer). And then classic development with tests.
What is the advantage of BDD?
- tests readable for non-programmers.
- they are easy to change. They are often written in almost pure English.
- they can now be written by the product owner or other interested parties.
- test results are more “human”.
- tests are independent of the target programming language. Migrating to another language is greatly simplified.
(the word tests is not highlighted by chance, because now tests are both descriptions and their actual implementation.)
Answer 2, authority 53%
- increase test development time as new dependencies are added
- make it harder to maintain tests as there are now more abstraction layers to support
no business analysts can write BDD tests because
- in the first place they just won’t do it but
- secondly, you can’t just write a test in free form in English and everything will work. You need to strictly follow the syntax and you need to know all the keywords and in what order they will work. And you need to map actions to these keywords on some kind of YAP
Thus, all the advantages promoted by BDD frameworks such as writing tests in natural language by non-technical people are not really applicable.
Answer 3, authority 18%
Please do not minus strongly, below is a joke:
BDD – bug-driven development , development on bugs. When a new feature is invented, decomposition is done, and immediately for testing. The tests fail (after all, no one has implemented anything yet), and bugs are introduced. The team starts fixing bugs by closing functionality.