wood burning stoves 2.0
The moose likes Design and the fly likes What is BDD, TDD, ATDD? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Design
Bookmark "What is BDD, TDD, ATDD?" Watch "What is BDD, TDD, ATDD?" New topic

What is BDD, TDD, ATDD?

Mani Sarkar

Joined: Jun 12, 2013
Posts: 6
Hi John,

Can you please explain in terms of steps or process during the dev process, the differences between the three and how they (can) play a role, individually or in a combination?

John Smart
Ranch Hand

Joined: Aug 06, 2013
Posts: 43
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.
Consider Paul's rocket mass heater.
subject: What is BDD, TDD, ATDD?
It's not a secret anymore!