Behavior Driven Development

If you haven't seen some of the Rails vs. _____ (Java, ColdFusion, .Net) links, I made available in the "Related Articles" section, you should check them out. They're really clever. The guys over at RailsEnvy do a great job with these.

They've also released a presentation about testing, introducing me to Behavior Driven Development which is like Test Driven Development, but with purpose. Instead of testing individual functions, Behavior Driven Development tests specific user actions and the result of these actions. The result of creating these behavior driven tests is a specification for how your application will perform... with a final application behaving in this manner after all tests pass. For Ruby, there is a framework called RSpec which can help facilitate this process.

For a while I've wanted to adopt a more test driven approach to my development. There are a lot of benefits: you only build what you need (don't overbuild), you know what you've built works (and can easily prove it), and you can test that future enhancements will not break any existing code. Unfortunately while I have started this process a number of times, I have not been diligent or disciplined enough to make it a habit... believing that the realities of deadlines didn't allow me the "luxury" of creating more automated tests. Hopefully with new inspiration from this presentation (and with the help of RSpec), I can finally make it stick.

Comments

Popular posts from this blog

I Believe...

FRail :include

Performance Tuning JCAPS - Part 2