Wednesday, November 21, 2012

What is difference between BDD and TDD?

When I read chapter 5 and chapter 6 of Engineering Long-lasting Software. Those chapters talk about BDD (Behavior-Driven Development) and TDD (Test-Driven Development) again and again. However, I did not see exactly difference between BDD and TDD because most technical blogs, and books say that “BDD is the diversity of TDD”, “BDD is an extension or revision of TDD.” By search and search, I just understand one difference between them.

TDD is for developers, and BDD is for customers. Those results are based on developer testing and customer testing

What are developer testing and customer testing?
Developer testing is that developer makes way of test for only developer.
Customer testing is that developer makes way of test for customer’s position.
Those testing are tested different ways. Developer testing runs program by bottom up to test step by step. On the other hand, customer testing runs program by top down to understand how entire program goes for customers.

As you see, ATDD (Acceptance Test-Driven development) is placed in Customer, and BDD is between TDD and ATDD on the picture. The reason why ATDD is placed in Customer is that ATDD is a one of cycle of testing and repeat testing to implement an application. If testing is passed, it will be the same meaning of implementation of the application. It is easy to make sure that complementation of the application and its progress by client’s Position. The reason why it is easy to make sure them is that BDD is using ubiquitous language. TDD is not using ubiquitous language because it is for developer. In case of BDD, a test and progress are described by ubiquitous language. So, BDD is more understandable than TDD to clients. So, this is the benefit to use ATDD on BDD for client. Therefore, BDD is for customers. I think that that is one of difference between TDD and BDD. I want to share this idea to understand difference between them. However, I could misunderstand about that. If so, Please let me know what I got wrong.

1 comment:

  1. Great blog post Yoshi! I think you've definitely got the right idea here. The point of behaviour driven development is to describe the things the system will do at a high enough level so that customers could potentially understand the BDD documentation (e.g. scenario or feature). The EdX HW3 focuses on BDD, and HW4 focuses on the drop from BDD to TDD. Have you tried either of those?

    You could boost your blog further by presenting a code snippet of a BDD scenario (e.g. cucumber) and a TDD spec (e.g. rspec) from those homeworks. I think that would drive the point home about the comprehensibility and the level of BDD vs TDD