Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the main factors that determine the project testing choice for (TDD or BDD) ?

user-image
Question added by Ahmed Galal , Senior Software Architect , Akhbar El Yom Foundation
Date Posted: 2015/09/20
Housam Tillaawei
by Housam Tillaawei , SEO Expert , Freelancer

Test-Driven Development

 

TDD is Contain five different stages:

 

First the developer writes some tests.

The developer then runs those tests and (obviously) they fail because none of those features are actually implemented.

Next the developer actually implements those tests in code.

If the developer writes his code well, then the in next stage he will see his tests pass.

The developer can then refactor his code, add comments, clean it up, as he wishes because the developer knows that if the new code breaks something, then the tests will alert him by failing.

The cycle can just continue as long as the developer has more features to add. A flowchart is given below of this cycle:

 

 

Behavior-Driven Development .. (Bdd)

Alright, so what is BDD you ask? Well that’s where the line gets a little fuzzy. Some people will say it is similar to TDD, others will say that it is just TDD but with better guidelines, or even a totally different approach to developing.

 

Whatever the actual definition is, it doesn’t matter that much. The main thing to know is that BDD is meant to eliminate issues that TDD might cause.

 

In contrast to TDD, BDD is when we write behavior & specification that then drives our software development. Behavior & specification might seem awfully similar to tests but the difference is very subtle and important.