The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends
by David Chelimsky, Dave Astels, Zach Dennis, Aslak Hellesøy, Bryan Helmkamp, Dan North
Is your team trying to do TDD and failing? Are you finding your test suites bloated and difficult to read, understand, or maintain? Business applications today are plagued with features that are never used, highly coupled code that is hard to change, and expensive test suites that aren’t run any more because they are brittle and unreadable.
RSpec, Ruby’s leading Behaviour Driven Development tool, helps you do TDD right by embracing the design and documentation aspects of TDD. It encourages readable, maintainable suites of code examples that not only test your code, they document it as well. The RSpec Book will teach you how to use RSpec, Cucumber, and other Ruby tools to develop truly agile software that gets you to market quickly and maintains its value as evolving market trends drive new requirements.
ISBN: 978-1-93435-637-1
Buy Now
This title is currently available in Beta. Buy the eBook now, and you'll be able to download successive releases of the eBook as the authors add material and correct mistakes. You'll get the final eBook when the book is finished.
If you buy the combo pack (Beta eBook + finished Paper Book) now, you'll get the Beta eBook immediately. You'll get the finished paper book when it's released (we're currently estimating September 20, 2010, but these dates can change).
About this Book
Behaviour Driven Development is about writing software that matters. It is an approach to agile software development that takes cues from Test Driven Development, Domain Driven Design, and Acceptance Test Driven Planning.
RSpec and Cucumber are the leading Behaviour Driven Development tools in Ruby. RSpec supports Test Driven Development in Ruby through the BDD lens, keeping your focus on design and documentation while also supporting thorough testing and quick fault isolation. Cucumber, RSpec’s steadfast companion, supports Acceptance Test Driven Planning with business-facing, executable requirements documentation that helps to ensure that you are writing relevant software targeted at real business needs.
The RSpec Book will introduce you to RSpec, Cucumber, and a number of other tools that make up the Ruby BDD family. Replete with tutorials and practical examples, the RSpec Book will help you get your BDD on, taking you from executable requirements to working software that is clean, well tested, well documented, flexible and highly maintainable.
Contents and Extracts
This book is currently in beta, so the contents and extracts will change as the book is developed.
- Getting Started with RSpec and Cucumber
- Introduction
- Hello
- Describing Features with Cucumber
- Automating Features with Cucumber
- Describing Code with RSpec excerpt
- Adding New Features
- Specifying an Algorithm
- Refactoring with Confidence
- Feeding Back What We’ve Learned
- Behaviour Driven Development
- The Case for BDD
- Writing Software That Matters
- RSpec
- Code Examples excerpt
- RSpec::Expectations
- RSpec::Mocks
- Tools And Integration
- Extending RSpec
- Cucumber
- Intro to Cucumber
- Cucumber Detail
- Behaviour Driven Rails
- BDD in Rails
- Cucumber with Rails excerpt
- Simulating the Browser with Webrat
- Automating the Browser with Webrat and Selenium
- Rails Views
- Rails Controllers
- Rails Models
About the Author
David Chelimsky is the lead developer/maintainer of RSpec. He has been developing software for nearly a decade, and exploring TDD for over five of those years. After three years training and mentoring agile teams at Object Mentor, David currently leads the software development team at Articulated Man, a Chicago based, interactive design firm. In his spare time, David likes to play guitar, travel, and speak something resembling Portuguese.
Dave Astels is a Software Engineer at Engine Yard and has been involved with software and computing for over 25 years, recently having spent several years working exclusively with Ruby and Rails. Dave wrote the article that prompted Steven Baker to start the RSpec project.
Zach Dennis is a lead developer and co-founder of Mutually Human Software, a Grand Rapids, MI based web development consultancy. He has been enjoying Ruby for nearly 7 years and has contributed to several projects such as Ruby’s standard library documentation, Ruby on Rails, and RSpec. In his spare time, Zach loves spending time with his wife, reading, listening to music, and running continuousthinking.com.
Bryan Helmkamp is the lead maintainer of Webrat, a library to implement acceptance testing of a Ruby web application in a more expressive and maintainable way. Following three years of Ruby on Rails consulting, Bryan is now a software engineer at Weplay, a New York City-based startup building online tools for the youth sports community.
Aslak Hellesøy is the Chief Scientist of BEKK Consulting, a Norwegian business and technology consulting firm. In 2003, after seven years of Java programming, he fell in love with Ruby. He has contributed to dozens of open source projects and is the founder of the Cucumber project. Aslak likes to cook, ski, and travel.
Dan North works with technology consultancy ThoughtWorks where he delivers software, coaches development teams, and hangs out at conferences. In 2003 and 2004 he developed the idea of Behaviour Driven Development and delights in the community that has grown up around RSpec and the enthusiasm and dedication of their core contributors.

