Behavior Driven Development - Tools



The development teams often have a misconception that BDD is a tool framework. In reality, BDD is a development approach rather than a tool framework. However, as in the case of other development approaches, there are tools for BDD also.

Several BDD Tools are in use for different platforms and programming languages. They are −

  • Cucumber (Ruby framework)

  • SpecFlow (.NET framework)

  • Behave (Python framework)

  • JBehave (Java framework)

  • JBehave Web (Java framework with Selenium integration)

  • Lettuce (Python framework)

  • Concordion (Java framework)

  • Behat (PHP framework)

  • Kahlan (PHP framework)

  • DaSpec (JavaScript framework)

  • Jasmine (JavaScript framework)

  • Cucumber-js (JavaScript framework)

  • Squish GUI Tester (BDD GUI Testing Tool for JavaScript, Python, Perl, Ruby and Tcl)

  • Spock (Groovy framework)

  • Yadda (Gherkin language support for frameworks such as Jasmine (JavaScript framework))

Cucumber

Cucumber is a free tool for executable specifications used globally. Cucumber lets the software development teams describe how software should behave in plain text. The text is written in a business-readable, domain-specific language and serves as documentation, automated tests and development-aid, all rolled into one format. You can use over forty different spoken languages (English, Chinese, etc.) with Cucumber.

Cucumber – Key Features

The key features of Cucumber are as follows −

  • Cucumber can be used for Executable Specifications, Test Automation and Living Documentation.

  • Cucumber works with Ruby, Java, NET, Flex or web applications written in any language.

  • Cucumber supports more succinct Tests in Tables - similar to what FIT does.

  • Cucumber has revolutionized the Software Development Life Cycle by melding requirements, automated testing and documentation into a cohesive one: plain text executable specifications that validate the software.

SpecFlow

SpecFlow is a BDD Tool for .NET Platform. SpecFlow is an open-source project. The source code is hosted on GitHub.

SpecFlow uses Gherkin Syntax for Features. The Gherkin format was introduced by Cucumber and is also used by other tools. The Gherkin language is maintained as a project on GitHub − https://github.com/cucumber/gherkin

Behave

Behave is used for Python framework.

  • Behave works with three types of files stored in a directory called “features” −

    • feature files with your behavior scenarios in it.

    • “steps” directory with Python step implementations for the scenarios.

    • Optionally, some environmental controls (code to run before and after steps, scenarios, features or the whole shooting match).

  • Behave features are written using Gherkin (with some modifications) and are named “name.feature”.

  • The tags attached to a feature and scenario are available in the environment functions via the “feature” or “scenario” object passed to them. On those objects there is an attribute called “tags” which is a list of the tag names attached, in the order they are found in the features file.

  • Modifications to the Gherkin Standard −

    • Behave can parse standard Gherkin files and extends Gherkin to allow lowercase step keywords because these can sometimes allow more readable feature specifications

Lettuce

Lettuce is a very simple BDD tool based on Cucumber. It can execute plain-text functional descriptions as automated tests for Python projects. Lettuce aims the most common tasks on BDD.

Concordion

Concordion is an open source tool for automating Specification by Example for Java Framework.

While the core features are simple, the Powerful extension framework API allows you to add functionality, such as using Excel spreadsheets as specifications, adding screenshots to the output, displaying logging information, etc.

Concordion lets you write the specifications in normal language using paragraphs, tables and proper punctuation and the structured Language using Given/When/Then is not necessary.

Concordion has been ported to other languages including −

  • C# (Concordion.NET)

  • Python (PyConcordion)

  • Ruby (Ruby-Concordion)

Advertisements