Cheers for your input Julian!

I'm doing it the "cucumber" way - basically writing the cucumber
tests, then impleneting the rspec tests first for each element I'm
about to develop. I find refactoring afterwards isn't an issue, as you
always refactor afterwards anyways. I'm not having any issues with
writing the rspec tests before code, as I've been doing that for some
time now, so it's working out well. I've also worked with rcov before
but I've found that if you write your tests before you write your
code, your coverage should be fairly close to 100% anyways (if not
smack bang on it).

One thing I have found about this approach (BDD -> TDD -> code) is
that I don't always cover all bases, and end up writing more tests
anyways (Without writing additional code), just to make sure that the
scenario or situation I've thought up is handled well enough by the
code.

For example, I realised today that with one of the requests I had
written, it was dependent on an integer value for the id, so I wrote a
scenario in cucumber that mimicked a user entering say "xyz" as the
id. My test passed fine as I was setting a default - but it was good
to check anyways.

I'm really liking the tight integration cucumber/webrat/selenium
offers along with the unit tests. It's just another level of
confidence that makes web development enjoyable and less stressful =)


Cheers,

Kirk Bushell
http://www.kirkbushell.com
Follow me: http://twitter.com/kirkbushell



On Mon, Jun 8, 2009 at 10:37 PM, Julian
Doherty<[email protected]> wrote:
> Rspec / cucumber is a good setup. It's what I'm running with on the project
> I'm on at the moment, and it works really well in practice. In addition,
> we've also got rcov set to fail the built if rspec coverage drops below
> 100%, and some pretty strict roodi and simian settings for checking code
> complexity / duplication. At first it was a bit weird working with the setup
> that tight, but this particular project was run that way since greenfield,
> and has managed to keep all that hanging together. The result is pretty
> pleasant to work with, without being too much of a drag (at least once you
> get used to it).
> My usual workflow is to write a feature in cucumber first to exercise the
> code at the high level. Then write it so cucumber passes. Then rspec it
> after I've written the code. Some would say I'm doing the rspec backwards,
> but I find it too restricting to stub/mock interfaces to do TDD with rspec
> as I'm writing the code. I find it slows me down, and *decreases* quality
> because refactoring gets harder if I'm having the nail down exactly how the
> code works with specs while it's still fluid and undefined. BDD fits really
> naturally though.
> Thanks for the video link as well :D
> cheers
> Julian Doherty
>
> 2009/6/4 Torm3nt <[email protected]>
>>
>> Thank you very much enrico, this presentation is fantastic!
>>
>>
>> --
>> Kirk Bushell
>> http://www.kirkbushell.com
>> Follow me: http://twitter.com/kirkbushell
>>
>>
>>
>> On Thu, Jun 4, 2009 at 9:19 AM, Enrico Teotti <[email protected]>
>> wrote:
>> >
>> > I found this talk very interesting:
>> >
>> > http://mwrc2009.confreaks.com/14-mar-2009-15-00-bdd-with-cucumber-ben-mabey.html
>> > towards the end (if I recall correctly) he makes a few considerations
>> > about how much Rspec to use when you have Cucumbers in place.
>> > HTH,
>> > Enrico
>> >
>> > 2009/6/3 Dr Nic Williams <[email protected]>:
>> >>
>> >> This is what we use.
>> >>
>> >> Cheers
>> >> Nic
>> >>
>> >> Mocra - http://mocra.com
>> >> Blog - http://drnicwilliams.com
>> >>
>> >> On 03/06/2009, at 4:18 PM, Torm3nt <[email protected]> wrote:
>> >>
>> >>>
>> >>> Hey all,
>> >>>
>> >>> Just curious of people's opinions of the types of automated testing
>> >>> they do, and where exactly they draw the line. For a new project I'm
>> >>> working on, am contemplating using RSpec for the unit-testing of
>> >>> models, controllers and views, and using Cucumber or Webrat for the
>> >>> integrated tests. Is this overkill? What setups do others use for
>> >>> total test coverage?
>> >>>
>> >>>
>> >>> Cheers,
>> >>> --
>> >>> Kirk Bushell
>> >>> http://www.kirkbushell.com
>> >>> Follow me: http://twitter.com/kirkbushell
>> >>>
>> >>> >
>> >>
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Enrico Teotti
>> > IT consultant, accessible web sites and web applications
>> > Sydney, NSW, Australia
>> > [email protected]
>> > mobile (IT) +393286590765
>> > mobile (AU) +00610416748450
>> >
>> > http://www.teotti.com
>> >
>> > >
>> >
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to