[rspec-users] bad specs better than none?
aslak.hellesoy at gmail.com
Tue Feb 26 00:59:14 EST 2008
On Tue, Feb 26, 2008 at 3:18 AM, Giles Bowkett <gilesb at gmail.com> wrote:
> Hi - I've got a bunch of people using specs at a company. Everybody is
> writing specs, but people are not really practicing BDD. As in, the
> specs are there, but it doesn't go, write spec, write code, repeat. I
> recently came across 8 failing specs checked into svn; I think the
> plan was, I'll write the design as specs, and then implement the
> entire design to match. Obviously that's not really the way it should
Here is how I would deal with this (and have dealt with it in the past)
1) In your standup meeting (if you have one) say you have an obstacle,
and that it's failing specs in svn. Don't explain why it's an
obstacle, just say you'd like to discuss it with the other devs after
2) Explain that you can't check in more code because you can't know
whether your new code is any good. When something fails you can't know
for sure whether it's due to "old" or new failing specs.
3) Try to get everyone to understand the benefits of a green SCM and
the dangers of a red one. This can take days and weeks. Only then can
you address the failing specs.
4) Set up Continuous Integration
5) Invest in some lamps and hook them up to your CI
> I also had to go into specs on a project I'm not working on, and found
> an unholy hive of database-accessing specs. It's disheartening.
> Basically, it's cargo cult development practices - using the "best
> practice" without actually understanding it.
What "best practice" are you referring to?
> Should I tell these people to throw away their specs? Should I train
> them in the BDD "spec first" cycle? What do you do when you have specs
> that are not really that useful? This is mostly Rails stuff; there's a
> lot of controller specs that duplicate model specs instead of stubbing
> out the behavior. It's driving me nuts but I have no idea what the
> solution is yet.
I don't know if your developers chose BDD/RSpec themselves (and got it
wrong) or if they were "assigned".
In any case, it sounds like there has been a lack of attention to
collective code ownership and staffing with appropriate skills.
Patience and pair programming would be my best suggestion. Have
someone who gets BDD (you?) pair with the whole team till they get it
too. And till they also get that they should fix bad code when they
> Giles Bowkett
> Blog: http://gilesbowkett.blogspot.com
> Portfolio: http://www.gilesgoatboy.org
> Tumblelog: http://giles.tumblr.com
> Podcast: http://hollywoodgrit.blogspot.com
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users