I am excited for the upcoming XpUtah (http://xputah.org). Ben Mabey will be running through his MountainWestRubyConference presentation on Cucumber a framework for writing acceptance tests.
We will be coding up the examples so bring your computer with the following installed:
Ruby (see RubyInstalled)
Ruby gems: cucumber, webrat, rspec, rspec-rails, rails, ZenTest
A useful mini-tutorial to make sure you have everything set up right: Rails 2 day 3
Background information
-Kay
Ben Mabey will be presenting on Cucumber.
The lecture will be a practice run for the Mountain West Ruby Conf and will be limited to 30 minutes (in theory at least). I'm hoping to get some good feedback from everyone about how I can improve the presentation. Cucumber is just as much a tool for Agile planning as it is for testing so I will be looking for feedback on both aspects.
Following that we should have quite a bit of time to go through some exercises. Here is what I would recommend you have installed if you want to code along:
- Ruby
Gems: cucumber, webrat, rspec, rspec-rails, rails (recommended: ZenTest)
Optional, but recommended:
Support for your favorite editor: http://wiki.github.com/aslakhellesoy/cucumber/related-tools
- git
This will be my first tutorial-like session so I'm looking for ideas on how to make the time the most productive with various exercises. What I am thinking so far is to first have an exercise of taking a business goal and turning it into a narrative (user story) and writing Cucumber scenarios. (I'm expecting this group to be better at this than me :).) Following that we can actually go through, either as pairs or a group, the actual implementation to get this feature passing. Does this sound reasonable? Please reply with any other ideas you have. Also, does anyone have ideas on what small feature/app we could try to implement?
Here is the summary of the lecture part:
Cucumber is a BDD tool that aids in outside-in development by executing plain-text features/stories as automated acceptance tests. Written in conjunction with the stakeholder, these Cucumber "features" clearly articulate business value and also serve as a practical guide throughout the development process: by explicitly outlining the expected outcomes of various scenarios developers know both where to begin and when they are finished. I will present the basic usage of Cucumber, primarily in the context of web applications, which will include a survey of the common tools used for in-memory and in-browser testing. Common questions and pitfalls that arise will also be discussed.
The outline of the lecture will be somewhat along these lines:
- The motivating factors and history behind Cucumber (BDD, TDD, DDD, FIT, and more acronyms :)).
- Basic usage of Cucumber.
- How to use with plain Ruby apps. Might even show how to use it on Java apps. (probably will just touch on this and focus on webapps.)
- How this applies in the context of web applications (rails, and others- framework and language agnostic)
- How to test JS in and out of browser with Cucumber.
Examples of how to use the available tools and libraries generally used: webrat, Selenium, Watir, HtmlUnit (most likely via Celerity), and more.
- How to use the various testing frameworks within Cucumber (RSpec, Test::Unit, Shoulda, etc...).
- Survey of related Cucumber tools (i.e. for editing).
- Common questions and pitfalls.
- Writing styles for scenarios and narratives.
- How to manage different Feature types.
