TDD or BDD ? What to use ?

The first step before finding the best software development process for you is figure out what are they and what really means using TDD or BDD. TDD or Test Driven Development is a software development process based on repetition of very short cycles. These cycles follows the sequence: Add a test, Run all the tests and see if the new test fails, Write the code, Run tests, Refactor code and then Repeat the process. TDD is about to write the test first then write the code and keep it as simple as possible. Its concepts is to keep the unit tests as small as possible. TDD is like testing in a white box where you care about the whole structure of the system. BDD or Behaviour Driven Development is also a software development process that emerged from TDD. Like TDD, BDD also consists in writing the test first, but from the point of view of the stakeholder/user. This methodology ensure that the requirement is fulfilled. BDD is about blackbox testing while TDD is white-box testing. But what is the best ? Which one should be used for your project ?
1 answer

BDD is TDD done right

This article solves the following challenge: 

TDD or BDD ? What to use ?

Some authors refer to BDD as TDD done right.
BDD follows the same processes as TDD but with the focus on the user. The test written have to fulfill the user story. The idea of creating the tests is that the method behaviour will be clear just by reading the sentence.
BDD follows a language that fits perfect in a agile user story:
Example:
Story - Returns go to stock
In order to keep track of stock
As a store owner I want to add items back to stock when they are returned
BDD tests: Refunded items should be returned to stock
Given a customer previously bought a black sweater from me
And I currently have three black sweaters left in stock
When he returns the sweater for a refund
Then I should have four black sweaters in stock
BDD builds upon TDD. You have technical quality with a business approach.

Evaluate complexity of present statement:

Select ratingCancelGuessingPassing knowledgeKnowledgeableExpert

Your rating: 3 Average: 3 (1 vote)

Taggings: