On Wed, Apr 21, 2010 at 7:05 PM, Pat Maddox <mailingli...@patmaddox.com>wrote:

> Cucumber features are the best tool I know of for capturing requirements
> from my customer.  RSpec specs are the best tool I know of for communicating
> intent and gauging code quality among the developer team.
>
> I'm not sure how exactly you're quantifying a 90/10 or 80/20 split.  I
> would expect that there would be a lot of overlap in coverage.  That is, any
> given line of code is likely to have some cucumber and some rspec coverage.
>  Personally I shoot for 100% RSpec coverage, and Cucumber is based entirely
> on what my customer wants.  If we discuss a new feature or bug fix and they
> feel I know exactly what they're talking about and don't need a cucumber
> test for it, I don't write the cucumber test.  Cukes are for teasing out
> requirements, which is most important when there's domain complexity that I
> don't understand, because I'm a programmer and not a domain expert.  Every
> line of code I write gets RSpec coverage.  That's how I personally feel
> confident that my code does what I think it does, and also helps me keep my
> dependencies under control.
>
> It's true that you can change out all the underlying code and cucumber
> tests still pass.  But you should be able to change out a lot of code and
> have your specs still pass, as well.  If you're changing the API then some
> specs might no longer be valid, or need to be moved, or whatever.  That's
> just a part of refactoring.  Although to be honest I think focused specs
> help me refactor more than other people, because I take really small steps
> when I refactor.  When most people "refactor" they tear out a bunch of shit
> and see if it still works.
>
> Cucumber tests tend to take longer because they're written at a much higher
> level.  That requires more setup, and more steps through the codebase.  For
> that reason, Cucumber isn't particularly good at giving me rapid feedback.
>  I want feedback in 10 seconds rather than 10 minutes.
>
> The best mantra I have for using Cucumber & RSpec in harmony is, "RSpec
> lets me know my code works right, Cucumber lets me know my code is doing the
> right work."
>

+1


-- 
Zach Dennis
http://www.continuousthinking.com (personal)
http://www.mutuallyhuman.com (hire me)
http://ideafoundry.info/behavior-driven-development (first rate BDD
training)
@zachdennis (twitter)
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to