Behavioral-driven Development BDD essence

Source: Internet
Author: User

BDD derives from TDD

Behavior-driven Development (Behavior-driven development, referred to as BDD) is a software development approach based on test-driven development (Test-driven DEVELOPMENT,TDD). The biggest drawback of TDD is that it often feels impossible to face a lot of functional requirements and use cases. On the other hand, since TDD is more focused on testing itself, it is easy to ignore the expression of business needs and eventually indulge in trivial details.

BDD avoids loss of information

Compared with the traditional method of software development, the essence of BDD is to avoid the loss of information that occurs during the translation process, such as requirement description, use case writing, code implementation, testing, etc. To this end, BDD takes use cases and example example as the core, and uses some unique concepts such as Gherkin and a series of BDD-specific tools to achieve a complete realization of the software requirements in a way that is closer to the business scenario. The comparison between the two is as shown.

Traditional software development process

BDD development process BDD process

Each iteration of BDD can be expressed as:

    • Plan the entire system and get abstract business objectives Goal
    • Refine your business objectives into a number of specific functional requirements feature
    • Take Given-when-then three-segment, describe and demonstrate specific features with specific scenario examples example
    • Convert example to executable specification
    • The specification is disassembled into a lower-level, approximation code-implemented low-level specification and testing test
    • Get the code implementation from low-level specification and extract the active document living documentation

Gherkin

Gherkin, which is the text used in BDD to describe a specific business scenario example example, takes a specific format. It is more specific than the requirements specification specification, somewhat similar to the use case, but more concrete and vivid. It can be used as a test script and as an archived content.

Feature: Transferring money between accounts
    on order to Manage my money more efficiently
    as a bank client
    I want to transfer funds between my accounts whenever I need to

    Scenario: transferring money-a savings account
        Given my Current account has a balance of 1000.00
           and my Savings Account have a balance of 2000.00
        when I transfer 500.00 From my current account to my Savings account
        then I Should has 500.00 in my current account
           and I should Has 2500.00 in my Savings account

Behavior-Driven Development BDD essence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.