Intro to Story Runner and BDD

Posted by Jimmy'z on May 19, 2008

Ben Mabey just posted a really good deck of slides on Story Runner and Behavior Driven Development (BDD) from a recent Utah Ruby User Group meeting.

Don’t be overwhelmed by the 99 slides. It moves really fast, and walks you through the history and concept of BDD.

Perhaps my favorite concept from the slide show is “Design is a Process, not a Phase.” As I have embraced Behavior Driven Development, I have seen improved software design come from the process. I believe this is true because writing the specs help create a clean public interface for your objects and classes. By having the tests that verify the behavior of your code, you can easily refactor without the worry of unknowingly breaking desired behavior.

Simple Tutorials For Learning BDD and RSpec 4

Posted by Jimmy'z on November 27, 2007

Behavior Driven Development (BDD) is quickly grabbing attention of developers who are looking for a better way of developing applications. BDD revolves around the idea of writing specifications for your application, writing the API that your code will need to implement to meet the specifications, and then finally implementing the API to pass all of the specifications.

I used to be guilty of not writing good tests for the code that I developed. I found it difficult to really find the meaning of writing the tests. I knew it was a good practice and would alert me if I broke my code later on, but I had a hard time figuring out what types of tests to write, and which code I actually needed to write tests for. I think this is a problem that Dave Astels saw happening in the Test Driven Development (TDD) world. See his original post leading to BDD.

Behavior Driven Development has helped me begin writing practical tests for my code, and has helped me focus on the specifications of what my application should be fulfilling. It has really caused quite a shift in my thought process.

RSpec is a testing framework that facilitates BDD for Ruby. It makes the testing during the development process work for you. You write your tests first, watch them fail (because you haven’t yet implemented anything yet), and then implement the code and see it pass. It’s a wonderful process, and RSpec makes it fun.

rspec-tests.png

The above example shows some some results of some Ruby development I’m currently working on. I’m working on implementing a FamilyTreeApi client’s person method. You’ll see that you can read the tests and see what the specifications are of that particular method. The Green are specifications that the library is currently passing, and the yellow are not yet implemented.

Below is the actual test for the first specification of the client ‘person’ method description.

rspec-code.png

If you are interested in learning more about BDD and RSpec, I suggest going through the following tutorials:

One more interesting thing with RSpec. Ben Maybe has posted an article on using RSpec for your C code. This is way cool, being able to harness the power of RSpec while writing an application in C.

Has anyone else seen any other good BDD frameworks for other languages? How about more good tutorials? What has been your experience with BDD or TDD?


purchase accutane online buy accutane cialis prescription order cialis without prescription buy cheap soma online generic synthroid accutane pills cheapest generic viagra lowest price acomplia propecia without a prescription cheap cialis from usa tablet viagra certified viagra buy cialis without prescription levitra discount cheap viagra in usa lowest price clomid order cheap viagra acomplia sale cialis rx order lasix viagra bangkok cheapest cialis prices online viagra cialis vendors buy soma online clomid sale buy cheap lasix online viagra free sample cialis in us viagra canada buy cialis from us soma no prescription cialis pill buy soma buy viagra in us soma for sale where to order viagra viagra buy drug viagra buy cialis in uk synthroid cheap cheap generic cialis buy cheap synthroid online discount propecia acomplia pharmacy order lasix online buy cialis in us soma without a prescription cheap propecia tablets cheap viagra tablets find cheap cialis cialis sales clomid online stores clomid prices compare viagra prices online cheap cialis no rx lasix without prescription cialis pills cialis purchase online pharmacy viagra buy cheap accutane find viagra on internet cialis order buy viagra cheap cheapest levitra cost of viagra cheap lasix tablets order cialis on internet order viagra in canada zithromax no prescription lowest price zithromax cheapest viagra prices