public
Description: Lazy coverage-aware running of Cucumber acceptance tests
Homepage: you're looking at it
Clone URL: git://github.com/mattwynne/cucover.git
name age message
file .gitignore Tue Jun 16 01:21:49 -0700 2009 Added logging [mattwynne]
file Licence.txt Sun Apr 19 02:41:11 -0700 2009 Add License. Clean out crap from old merge [mattwynne]
file README.markdown Tue Jun 23 00:34:26 -0700 2009 Update todo [mattwynne]
file Rakefile Tue Jun 23 00:08:44 -0700 2009 Fix dependency on logging [mattwynne]
file VERSION Tue Jun 23 00:09:05 -0700 2009 Version bump to 0.1.1 [mattwynne]
directory bin/ Mon Jun 15 16:02:05 -0700 2009 Going on a mad refactoring tangent, adding a co... [mattwynne]
file cucover.gemspec Tue Jun 23 00:21:45 -0700 2009 Turn off logging in production [mattwynne]
directory examples/ Mon Jun 15 16:02:05 -0700 2009 Going on a mad refactoring tangent, adding a co... [mattwynne]
directory features/ Sun Jun 21 13:45:22 -0700 2009 Cleaning up [mattwynne]
directory lib/ Tue Jun 23 00:21:45 -0700 2009 Turn off logging in production [mattwynne]
directory spec/ Sun Jun 21 14:21:35 -0700 2009 Refactoring and cleaning up [mattwynne]
directory tmp/ Tue Jun 16 01:21:49 -0700 2009 Added logging [mattwynne]
README.markdown

Cucover

Cucover is a thin wrapper for Cucumber which makes it lazy.

Question: What does it mean for Cucumber to be lazy?

Answer: It will only run a scenario if it needs to.

How does it decide whether it needs to run a scenario? Every time you run a feature using Cucover, it watches the code in your application that is executed, and remembers. The next time you run Cucover, it skips a scenario if the source files (or the feature itself) have not been changed since it was last run.

Features

  • Within a feature, Cucover will only re-run the Scenarios that have been affected by your changes
  • Uses RCov to map features to covered source files
  • Patches Rails to also map scenarios to covered .erb view templates
  • Shows skipped Scenarios, for confidence
  • Re-runs failing features, even when nothing has changed, for that good old red-bar feel.
  • Allows you to see which lines of a source file are tested by which scenarios

Installation and Usage

sudo gem install mattwynne-cucover --source http://gems.github.com

To run your features lazily, use the cucover binary instead of cucumber:

cucover -- features/lamb_chops.feature

To see what Cucover has already recorded (in the cucover.data file):

cucover --show-recordings

To find out which tests cover which lines of a given source file:

cucover --coverage_of path/to/some_source_file.rb

Limitations

  • Anything that runs out of process will not be covered, and therefore cannot trigger a re-run, so if you use Cucumber to drive Selenium, for example, you're out of luck.
  • This is very new and experimental. There may be bugs. Feedback is welcome via github messages.

Todo

  • Proper args parsing and command-line help
  • Work on a way to include coverage from out-of-process ruby code run during a test
  • Speed up the whole thing by only writing the recordings to disk when the process exits
  • Run code coverage and remove any slop following refactoring
  • Speed up the Rails test - maybe strip some guff out of the environment load?

Similar 'Selective Testing' Tools

  • JTestMe
  • Infinitest
    • http://code.google.com/p/infinitest/
    • Contact: Ben Rady
  • Google Testar
    • http://code.google.com/p/google-testar/
    • Contact: Misha Dmitriev
  • Clover test optimization
    • http://www.atlassian.com/software/clover/features/optimization.jsp
  • JUnitMax
    • a selective testing tool by Kent Beck
    • http://junitmax.com/