Cliff Moon on 13 Sep 2007 18:14:29 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] rspec slides


+1 on testing as a design philosophy.  I find that doing test first
design forces me to focus on expectations and results rather than
implementation.  This inversion of thinking keeps me from letting the
implementation details drive the design of my API's.

As for BDD, my understanding is that the point of it is to make your
tests into executable documentation.  In my line of thinking it's more
DRY to maintain a single executable set of specifications for code
behavior.  Contrasted against trying to maintain and verify a dead
document of specifications against a constantly changing codebase and
set of requirements, we can see that BDD is a big win for DRY.  It's
just that the process is DRY, not necessarily the code of the
tests/specs themselves.

Bearing that in mind, BDD might not make a whole lot of sense for
personal or small scale projects.  YMMV.  But if you answer to
non-technical people, then it's a big win to have executable
documentation.  You can hand your specs off to the BA/client/QA person
and expect them to be able to read it with minimal help.  And the best
part is that 6 months down the road when your code is being audited for
no good reason you can happily say that your docs are up to date because
the little bar is green when you run them.

Steve Eichert wrote:
> I, for one, think that this is the perfect forum to debate and inform
> others.  I also think that the most valuable insight into a given
> technology comes from using it day in and day out and seeing its
> "warts".  Once those warts are uncovered you can begin to make
> informed decisions about the most appropriate and beneficial ways to
> use the given technology.
>
> Back to one of the topics addressed in the critique of RSpec.  It was
> mentioned that RSpec causes you to violate the DRY principal.  Do you
> think that violation is appropriate?  I've found that when writing
> tests/specifications you should always prefer readability over
> DRY'ness.  As I've heard others say "production code needs to be dry,
> but tests don't".
>
> http://beechbonanza.blogspot.com/2007/07/production-code-needs-to-be-dry-tests.html
> http://blog.jayfields.com/2007/06/testing-inline-setup.html
>
> One of the other things that I'd be interested in hearing more about
> from those who are using RSpec is does it tend to push you in the
> direction of using it as a testing/verification tool or as a design
> tool.  One of  the biggest problems I have with the term "Test Driven
> Development" is that it leads people to think that its about testing,
> when in actuality it's all about design.  People (myself included)
> tend to get caught up in the test part of TDD and forget that the
> point of TDD, as it was originally "developed", is to help you design
> your software in a certain way.  So, for those using RSpec, do you
> think BDD and RSpec help you stay more focused on the design aspects
> that are the key to TDD, or does it cause you to go more towards the
> testing/verification mindset?  My initial impression is that it might
> lead you to just worry about whether your code passes the
> specifications, and not necessarily towards the best design.
>
> Cheers,
> Steve
>
> On 9/13/07, *Cassius Rosenthal* <cassius@xmodulation.com
> <mailto:cassius@xmodulation.com>> wrote:
>
>     Well, I didn't mean to tick anybody off, and I apologize if I hit a
>     nerve.  I was pretty clear in my first email that I think everybody
>     should use RSpec despite it's drawbacks.
>
>     My criticism of RSpec comes from using it in several projects over
>     the
>     past few months, and I intend my criticism to be constructive both to
>     those who are trying to understand RSpec, and to those who would
>     improve
>     upon it.
>
>     I think it would be a disservice to those who are new to RSpec to
>     dismiss its problems or to recommend its application where it is
>     inappropriate.  Surely this is a good forum to debate and thus inform?
>
>     Thanks!
>     -Casey
>
>
>     Colin A. Bartlett wrote:
>     > Cassius Rosenthal wrote:
>     > > *a bunch of stuff*
>     >
>     > You win. I'm dumping RSpec.
>     >
>     >
>     >
>     >
>     >
>     >
>     > Not.
>     > But I do have far more important things to do then battle geek
>     to geek
>     > in cyberspace.
>     >
>
>     _______________________________________________
>     To unsubscribe or change your settings, visit:
>     http://lists.phillyonrails.org/mailman/listinfo/talk
>     <http://lists.phillyonrails.org/mailman/listinfo/talk>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> To unsubscribe or change your settings, visit:
> http://lists.phillyonrails.org/mailman/listinfo/talk
>   

_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk