[rspec-users] Quickcheck testing framework

David Chelimsky dchelimsky at gmail.com
Sun May 16 20:13:28 EDT 2010

On May 16, 2010, at 12:54 PM, Scott Taylor wrote:

> Hey all,
> I'm wondering if anyone has any experience with an automated test-case generation tool like Quickcheck (for erlang/haskell). I'd be interested in hearing any impressions, war stories, or dev workflows regarding a tool like this.  Talking off list to David C, he suggested that it might be a complimentary tool to a TDD/BDD framework like rspec. 

My thinking here is that it could be useful to drive out an initial implementation using TDD, and at the point we think we've got the solution we want, add something quickcheck-like to try to poke holes in it. I'd probably then add new examples if any cases I hadn't considered were revealed through this process.

> It appears as though there is a similar project out there for ruby named rushcheck (http://rushcheck.rubyforge.org/).  

It's up on github too: http://github.com/hayeah/rushcheck. Same guy has this too: http://github.com/hayeah/rantly - random data generator - looks like you could do stuff like:

Rantly.new.each(100) do
  thing.method_that_accepts_a_string(string).should have_some_quality

This would cause 100 random strings to be generated and passed to thing.method_that_accepts_a_string. Assuming the matcher verifies some set of rules about the outcomes,  you've basically got quick check.

The documentation is behind (the lib used to be called something else and some method names have changed), but I think it wouldn't take much work to be able to adapt this for use in RSpec.

> Doesn't seem like it's been maintained in a few years, though, and I'm guessing no one is using it. I wonder if it these automated test generation tools are more appropriate in functional languages like Haskell and Erlang.

More information about the rspec-users mailing list