March 1, 2021
Hot Topics:

Apply Behavior Driven Development to Ruby on Rails with Rspec

  • By Saurabh Bhatia
  • Send Email »
  • More Articles »

Applying the Behavior Driven Development (BDD) methodology with a Ruby-based BDD framework allows you to write system requirements in a Ruby format first and then write Ruby code for the particular features of those requirements. Because the Ruby format is similar to plain English, business analysts and the people gathering the requirements can participate in the development process.

A few different Ruby-based BDD frameworks are available. RSpec, Cucumber, and Shoulda are the most popular. Find out how RSpec works by using the use case of an employee information manager.

BDD mandates that you write tests for each step of the process, which leads to cleaner code. The BDD process begins with the development team creating a scenario, for which they describe each feature. The initial scenario inevitably fails. The team subsequently defines each step (iterative test) and writes the application code for each feature. They also refactor the code when the scenario passes each step.

Read the full story at Web Developer's Virtual Library:
Apply Behavior Driven Development to Ruby on Rails with Rspec

This article was originally published on February 5, 2010

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date