[rspec-users] [ANN] rspec_todo -- spec'ing backwards

Pat Maddox pergesu at gmail.com
Sun Sep 16 15:38:42 EDT 2007


On 9/16/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
>
> On Sep 16, 2007, at 3:04 PM, David Chelimsky wrote:
>
> > On 9/16/07, s.ross <cwdinfo at gmail.com> wrote:
> >> While the spirit of BDD is to spec first and code second, many of us
> >> have legacy code. Worse, some of us have legacy code without very
> >> good coverage. Recognizing that *I* have such code, I created a
> >> script that grinds through your .rb files and creates placeholder
> >> specs for each public method.
> >>
> >> While it is more sensible to spec behavior of code function than of
> >> individual methods, this tool can help jump start a transition to
> >> that wonderful place.
> >
> > Hi Steve,
> >
> > There are tools that will do this for you on java projects and in
> > nearly every case that I've seen them used, the result has been 100
> > line test methods, one per object method, that take the object through
> > multiple states, become impossible to understand, and often just get
> > commented out.
> >
> > Worse, even though you sell it as a tool for dealing with legacy code
> > (code without tests), it will end up becoming the tool people use and,
> > even worse than that, they'll think it's BDD because it creates specs
> > and not tests.
> >
> > I beg you (I'm on my knees as I'm writing this) to throw this
> > manuscript in the fire now!
>
>
> I agree with David (you can also look at the ZenTest suite, which has
> a similar tool).  I haven't looked at the tool, but how about
> modifying it to create comments in the specs, somthing like this:
>
> # You haven't specified the behaviour of User#method1!
> # You haven't specified the behaviour of User#method2!
>
> Scott
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>

Why not use RCov?  Seeing a bunch of red is a much bigger motivator
than a lame comment.

Pat


More information about the rspec-users mailing list