[rspec-users] scenarios on production data

Tero Tilus tero at tilus.net
Mon Sep 8 15:48:24 EDT 2008


2008-09-05 16:10, Nick Hoffman:
> I know what you mean about it feeling reassuring to know that your
> tests/specs passed when run on production data. However, if your
> specs, scenarios, tests, etc cover all behaviours, situations, edge
> cases, etc, then you needn't worry. All is well.

I think you are overlooking the often stressed point of tests.  You
are supposed to gain confidence on your codebase by testing.  If you
have covered everything you can think of and still have the gut
feeling that some end user voodoo hiding in production environment
will kill your mighty app, why not run tests against production data
too?  

You know very well, that if you have that icky feeling, it's not gonna
go away if somebody says "you needn't worry".  ;)

Of course, if you hit something in production data, you should
immediately isolate and reproduce the case in your tests and then go
debugging.  That way you aren't actually using production data as test
data, but using it to develop the test data.  And isn't that
(reproducing a crack in production env into tests) just what the
Laziness[1] is for too?

[1] http://agilewebdevelopment.com/plugins/laziness

-- 
Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/


More information about the rspec-users mailing list