There’s no place like ::1

BDD and RSpec

| Comments

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?!

Comments