BDD & Rspec
-
Upload
robbert -
Category
Technology
-
view
4.405 -
download
1
description
Transcript of BDD & Rspec
![Page 1: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/1.jpg)
Behaviour Driven Development withRSpec
Aslak HellesøyCTOblog.aslakhellesoy.com
![Page 2: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/2.jpg)
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
![Page 3: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/3.jpg)
GSoC
![Page 4: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/4.jpg)
JRuby << RSpec
![Page 5: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/5.jpg)
Background
![Page 6: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/6.jpg)
TDD
![Page 7: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/7.jpg)
Problem
![Page 8: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/8.jpg)
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
![Page 9: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/9.jpg)
Test?
![Page 10: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/10.jpg)
Assert??
![Page 11: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/11.jpg)
Sapir-Whorf
![Page 12: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/12.jpg)
BDD
![Page 13: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/13.jpg)
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
![Page 14: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/14.jpg)
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.
![Page 15: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/15.jpg)
As a bowler
I want to have my score calculated
So that I don’t have to do it myself
![Page 16: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/16.jpg)
![Page 17: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/17.jpg)
Design
Documentation
Tests
![Page 18: BDD & Rspec](https://reader034.fdocuments.net/reader034/viewer/2022050804/54544909b1af9f95228b49e4/html5/thumbnails/18.jpg)
http://rspec.rubyforge.org/