BDD and TDD, what is the correct workflow?

My understanding is that:

BDD is the process of evaluating how the software should behave, and then recording the acceptance tests that your code is based on. You must write code using the TDD approach by writing unit tests for methods and building your classes around unit tests (code, test, refactoring). When the code is written, you check it to make sure that it meets the initial acceptance test.

Can someone with the experience of a full comment about my interpretation and skip a simple application using these flexible principles? I see that BDD and TDD have a lot of text in separate publications, but I watch how these two processes complement each other in the real world.

+4
source share
3 answers

Try to think of them as examples, not tests.

For the entire application, we give an example of how the user can use this application. An example is a concrete example of behavior that illustrates this behavior. So, for example, we can say that the “do” application allows for refunds. The do statement that uses this do will be familiar with the scenario in which Fred returns the microwave to return:

Given that Fred bought the microwave for $ 100.
When he returns the microwave back for a refund, then he must return $ 100 to his credit card.

; , , 90 , , , ..

, ; , , .. . , , , . . RefundCalculator unit test shouldTakeDiscountsIntoAccount.

, :

// Given a microwave was sold at 10% discount for $100

...

// When we calculate the refund due

...

// Then the calculator should tell us it $90.

...

, unit test, , .

"BDD" , , , . , , , - ( , ). , BDD ATDD (Accept-Test-Driven Development), BDD TDD. , , .

, "", , , , , .

" " ( ) " " .

+4

. : , , , "BDD" , , , , "TDD" . . . , , , , , - .

+1

BDD, . , , , script .

, Agile Test First/Test Driven Development, BDD, , , BDD , .

?

0

Source: https://habr.com/ru/post/1534319/


All Articles