BDD & Rspec

Post on 31-Oct-2014

4,388 views 1 download

description

Aslak Hellesøy's slide's of his presentation at the RubyenRails 2007 conf in Amsterdam

transcript

Behaviour Driven Development withRSpec

Aslak HellesøyCTOblog.aslakhellesoy.com

David Chelimsky Aslak Hellesøy 16000 downloads Ranked 31 at RubyForge 40 contributors 2000 svn commits 890.000 Google hits 100% coverage 100% self describing 833 examples

GSoC

JRuby << RSpec

Background

TDD

Problem

Developers don’t know...

• where to start

• what to test

• what not to test

• how much to test in one go

• what to call tests

• how to fix a broken test

• that TDD is about design

Test?

Assert??

Sapir-Whorf

BDD

BDD helps you realise

• where to start

• what to test

• what not to test

• how much to test in one go

• what to call tests

• how to fix a broken test

• that TDD is about design

• outside-in

• user stories

• anything else

• as little as possible

• intent

• documentation

• RSpec

BehaviourThe actions or reactions of an object or organism, usually in relation to the environment.

Anything that an organism does involving action and response to stimulation.

Anything a computer system does in response to messages.

As a bowler

I want to have my score calculated

So that I don’t have to do it myself

Design

Documentation

Tests

http://rspec.rubyforge.org/