Behavior Driven Design (BDD)

Testing Infrastructure

Syntax Example

Story: Returns go to stock

As a store owner
In order to keep track of stock
I want to add items back to stock when they're returned.

Scenario 1: Refunded items should be returned to stock
Given that a customer previously bought a black sweater from me
And I have three black sweaters in stock.
When they return the black sweater for a refund
Then I should have four black sweaters in stock.

Scenario 2: Replaced items should be returned to stock
Given that a customer previously bought a blue garment from me
And I have two blue garments in stock
And three black garments in stock.
When they return the blue garment for a replacement in black
Then I should have three blue garments in stock
And two black garments in stock.

Documentation / Reference





Discover More
Testing Infrastructure
Cucumber

is a Behavior Driven Design (BDD) framework that takes “stories” or scenarios written in human readable languages such as English and turns those human readable text into a software test. This makes...
Javascript Test - Assertion library

assertion in Javascript assert module - Node.js’ built-in assert module shouldjs/should.jsshould.js - BDD style LearnBoost/expect.jsexpect.js - expect()...
Javascript Test - Mocha

mocha is a javascript test runner running on Node.js and in the browser, making asynchronous testing simple and fun with its default BDD-style interface. ...



Share this page:
Follow us:
Task Runner