Acceptance Testing Java Applications with Cucumber, RSpec, and JRuby
Cucumber is a new acceptance testing (AT) tool that works with RSpec. Already popular in the Ruby community, this tutorial shows you how to use Cucumber to test drive Java applications, when you combine Cucumber and RSpec with JRuby.
We’ll also discuss Cucumber vs. FitNesse and using RSpec vs. JUnit. You’ll learn tips for writing good acceptance tests. Half of the time will be devoted to a hands-on exercises, where you will test drive a simple Java application using Cucumber.
Bring your laptop (or a pair partner with one), with the latest Cucumber, RSpec, and JRuby installed.
- 30 mins: Walk through the tool chain, showing how JRuby integrates Cucumber with a Java system under test (SUT).
- 30 mins: Examples of Cucumber specifications, including tips for writing good specifications.
- 90 mins: Exercise that builds on the examples, where the attendees will pair up and implement several features, driving them with Cucumber specifications and unit testing the changes with JUnit or RSpec.
- 30 mins: Wrap up with some comments about the pros and cons of Cucumber vs. Fitnesse and the advantages and disadvantages of using RSpec for unit testing.
Note: I originally proposed this for the testing stage, after some debate about which stage was best. Lisa Crispin also raised the question and suggested either this stage or the Dev. Jam. I think this stage is a slightly better fit, but I’m open to feedback.
- How to use JRuby to integrate Ruby and Java applications.
- How to use Cucumber as an acceptance testing tool for Java applications.
- The pros and cons of Cucumber vs. FitNesse.
- The pros and cons of RSpec as a unit testing tool for Java.