Hi Mani,
In simple terms, BDD can be viewed as an approach that includes both ATDD (automated acceptance critieria) and TDD (at the coding level).
- When discovering and defining the requirements, we use concrete examples and scenarios to help understand what the customer really needs, and, where possible, we use automated acceptance criteria to enhance feedback and communication. So like ATDD (Acceptance-Test Driven Development), BDD involves automating acceptance criteria. However BDD places more emphasis on making sure the examples being automated are expressed in a form that can be easily understood and validated by the whole team (including the customer)
- At a coding level, BDD uses a variation of TDD - like TDD, we use
unit tests to design our code. However, with BDD, we emphasis that the unit tests describe the *expected behavior* of the code ("what should this class do?") as opposed to just testing methods. So we might write a test called "shouldTransferFundsToDesinationAccount()", rather than just "testTransfer()". We try to think in terms of "executable specifications" rather than just unit tests, and some dedicated unit testing BDD tools (Spock, Jasmine, Rspec...) help express tests in these terms. This has the design benefits of traditional Kent-Beck style TDD, but also documents the design better, and helps ensure that the behavior being implemented contributes to the original business value defined in the acceptance criteria.
- John.