I never liked the TDD technique. It was too much XP(Extreme Programming) for me. There are people that are just convicted that TDD is the best development technique since sliced bread!

Recently, I’ve been watching alternative development techniques. One that caught my attention was BDD (wikipedia). The basic idea is that one should question and write the expected behaviour of the application, creating a specification that guides the development process.

There are many helper tools available to integrate this kind of behaviour tests in your favourite language. Since I am becoming a Ruby fan, I looked at RSpec:

RSpec is a a framework which provides programmers with a Domain Specific Language to describe the behaviour of Ruby code with readable, executable examples that guide you in the design process and serve well as both documentation and test.

The examples on the RSpec webpage shows a slick and natural DSL for describing behaviour specifications. Try them! So natural, so practical, so clean…. I’m in love! And if you are a Rails addict, you must know that on the same RSpec webpage, there is a plugin you can use to integrate RSpec tests and ActiveRecord helpers in you favourite Rails application!! SWEET!!

Oh and it is incredibly simple to extend RSpec with your own matchers. And I even didn’t talk about Mocks and Stubs! So much things to explore… At the end, BDD could not be the answer for all your testing requisites, but IMHO it is a serious candidate for my future applications’ tests.

PS – Do you know any BDD framework for Perl applications?!

About

photo of Ruben Fonseca

My name is Ruben Fonseca. I'm a Computer Science and Systems Engineer from Portugal that loves FLOSS.

I'm currently an Open Source Consultant at Lisbon, Portugal. This blog is about my daily geek life.

You can contact me anytime at or via LinkedIn:

View Ruben Fonseca's profile on LinkedIn

Feeds

Related Posts

You may be interested in these posts too:

1 Comment | rss | atom | xml | json

  1. avatar Devin Mon 28, 2008 17:16

    Do you know any BDD framework for Perl

    In his journal <http://use.perl.org/~chromatic/journal/35600>, chromatic informs us that RSpec is full of leaky abstractions and Perl’s suite of Test::foo classes already solve the problem. He suggests FIT for a BDD framework that doesn’t look like pidgin.

new comment New Comment