[rspec-users] Something like rcov but more explicit?

aslak hellesoy aslak.hellesoy at gmail.com
Wed Jun 20 08:01:36 EDT 2007


On 6/20/07, Ian Leitch <port001 at gmail.com> wrote:
> On 18/06/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> > On 6/18/07, Ian Leitch <port001 at gmail.com> wrote:
> > > Hey list,
> > >
> > > Does anything exist that can show me which lines are explicitly tested?
> RCov
> > > is great, but it doesn't really give a sense of _actual_ coverage,
> indeed,
> > > there is no guarantee that functions executed were in fact called as the
> > > result of a line being tested.
> > >
> >
> > Why do you care whether a line was executed directly (spec->code) or
> > indirectly (spec->code->code->code)?
>
>
> Just because a spec executed a function coincidentally and it generates some
> kind of error (most likely semantic), there is no guarantee that the code
> that made the call will also trip up.

Are you saying that an 'explicit' call to that method would give you
confidence about how the code that made the call will behave? In the
scenario you're describing this 'intermediate' code isn't even
involved.

Maybe I'm misunderstanding what you're trying to do. Some sample code
would help.

I'm also sceptical about having a goal along the lines of "all methods
in our code must be invoked explicitly by specs". It's a very low
level (too low level IMO) way of approaching the overall behaviour of
your app.

Aslak

> Therefore, rcov doesn't really tell me
> to what extent my code base is explicitly tested.
>
> > > I know nothing of the rspec internals, but would a simple list of
> executed
> > > lines be a relatively simple feature to add?
> > >
> >
> > That would be hard I think. Feel free to investigate it. I would
> > rather recommend you use RSpec's --heckle switch if you want to know
> > how good your examples are. Coverage is overrated.
> >
> > See http://seattlerb.rubyforge.org/heckle/ for more info.
>
> Thanks, I'll give Heckle a look.
>
> > Aslak
> >
> > > Cheers
> > > Ian
> > >
> > > _______________________________________________
> > > rspec-users mailing list
> > > rspec-users at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rspec-users
> > >
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list