Introducing behavior driven development

What is BDD?

BDD, Behavior-driven development, means we define how the users behave when using our software. How they interact with the app. And we only write the first single line of code when such interaction is defined into the feature spec.

Before getting into the BDD, we want to create a new empty project to demonstrate the test first approach. We don’t want to write our code and then add tests to test our code. Instead, we write the features spec at the beginning and write code to meet the spec requirement.

We are going to re-creating the photo album.

Let’s create a new project named gallery and migrate the DB the first time.

$ rails _3.2.8_ new gallery
$ cd gallery
$ rake db:migrate

What’s next? We’re going to take a look at “Installing cucumber for rails”.

overlaied image when clicked on thumbnail

Makzan | Ruby on rails 101 | Table of Content