Wednesday, 10 July 2019

TDD vs BDD

In this post , I'll explain terms  TDD and BDD in detail.

TDD: Test Driven Development
BDD: Behavior Driven Development

                                                  Test Driven Development


TDD is a software development technique that involves writing automated test cases prior to writing functional pieces of the code. This is popular in agile methodologies as it drives delivering a shippable product at the end of the spirit. This process can be divided into multiple steps:

         1. A developer, based on requirement documents, writes an automated test case.


2.     The development team runs these automated test scripts against what is currently developed and the tests fail, as they should since none of the features have been implemented yet.


3.     development team functional code to ensure the automated test script gives them a green light.


4.     The development team can then refactor and organize the code to produce a tested deliverable at the end of the sprint.




     Test cases are mostly written in programming languages such as Java, Ruby, etc. and can be written using test automation tools such as Selenium.
   

       Behavior Driven Development 
                       (BDD)

BDD is a software development technique that defines the user behavior prior to writing test automation scripts or the functional pieces of code. Used in an agile sprint, this method ensures that a shippable product is generated at the end of a sprint. This involves:

1.     Behavior of the user is defined by a product owner/business analyst/QA in simple English.
2.     These are then converted to automated scripts to run against functional code.
3.     The development team then starts writing the functional code to ensure the automated test script gives them a green light.

4. The development team can then refactor and organize the code to produce a tested deliverable at the end of the sprint.





TDD vs. BDD

1.     BDD is in a more readable format by every stake holder since it is in English, unlike TDD test cases written in programming languages such as Ruby, Java etc.
2.     BDD explains the behavior of an application for the end user while TDD focuses on how functionality is implemented. Changes on functionality can be accommodated with less impact in BDD as opposed to TDD. 

3.     BDD enables all the stakeholders to be on the same page with requirements which makes acceptance easy, as opposed to TDD.


If this post is really helpful, then Please hit 'Like' on this page.

Thanks! 



No comments:

Post a Comment