an introduction to behavior-driven development (bdd)

17
An introduction to Behavior-Driven Development - By Suman Guha

Upload: suman-guha

Post on 19-Aug-2014

454 views

Category:

Engineering


3 download

DESCRIPTION

An introduction to Behavior-Driven Development, BDD, TDD, TFD, ATDD,

TRANSCRIPT

An introduction to Behavior-Driven Development

- By Suman Guha

BDD not only helps you develop software correctly, but it ensures you develop the correct software.

As per McKinsey and Company and Oxford University Research States:

17% of software projects go so badly, they threaten the very existence of the

company.

The Problem

As per McKinsey and Company and Oxford University Research States:

On average, large IT projects run45% over budget and 7% over time,while delivering 56% less value than

predicted.

Software Development Success Is Thwarted By The Requirements Gap

Test-Driven Development (TDD) ensures that you built the software correctly, Not that the correct

software was built.

The Problem

What thecustomer wanted

What theanalyst

specified

What thedevelopers

programmed

What was released after cost overturns

Defects found and remedied early in the software development life cycle reduce development costs

and save time.

Stone Age Practice: Traditional QA

QA Testing Establishes Tests That Typically Measure Software’s Adherence to Documented Requirements

Modern Recipe: Acceptance Test-Driven Development

Acceptance Test-Driven Development establishes a feedback loop that assures adherence to customer requirements

Ultra Modern Recipe: Behavior-Driven Development

Behavior-Driven Development codifies customer requirements into scenarios that are automated in a TDD test-first iteration and output test reports as part of a continuous build integration cycle

Ultra Modern Recipe: Behavior-Driven Development

Behavior-Driven Development codifies customer requirements into discrete, real-life scenarios that are automated in testing frameworks and output test reports as part of a continuous integration pipeline.

Sample

Feature: get cash from an ATM

Background:

Given the ATM has 1000

And the user John is authenticated

And the user's account has 5000

Scenario: success

When the user asks the ATM for 500

Then the ATM will have 500

And the user's account will have 4500

And the ATM will provide 500 in cash

Scenario: not enough money in the ATM

When the user asks the ATM for 1500

Then the ATM will have 1000

And the user's account will have 5000

And the ATM will notify the user it does not have enough cash

What needs to happen

Three disciplines recommended by the development community, Test-Driven Development, Behavior-Driven Development and Domain-Driven Design

Hybrid Practice

Hybrid practice

The intersection of TDD, DDD and BDD provide an

hybrid approach to development which

assures predictable and productive outcome.

Waterfall SDLC vs Test-First with BDD

Integrating Disciplined Testing Through BDD Reduces The “Testing Tail” and Avoids Late Surprises