Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is BDD, TDD, ATDD?

 
Mani Sarkar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Cheers,
mani
 
John Smart
Author
Ranch Hand
Posts: 43
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic