[rspec-users] bad specs better than none?

Pat Maddox pergesu at gmail.com
Thu Feb 28 02:57:10 EST 2008


On Mon, Feb 25, 2008 at 6:18 PM, 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
>  be.

Here's my theory.

Ranked, in ascending order of desirability:
No tests
Green suite, poor tests
Red suite, poor tests
Red suite, quality tests
Green suite, quality tests

A passing suite of high-quality tests gives you confidence that your
system works well.  If your tests are of low quality, then you will be
confident, but your confidence will be misguided, and so you disrupt
the balance of what the team knows vs what the team thinks it knows.
The team has good values but does not understand the principles.

A broken suite of low-quality tests sounds discouraging, but I believe
it is a positive situation, because the team's understanding of the
values and principles can grow at the same rate, rather than one
dominating the other like a weed.  Some teams and team members will be
cynical, some will be eager but struggle.  Most importantly though,
they will be realistic.

A broken suite of high-quality tests signifies a breakdown in process.
 Unlike before, the problem at this stage is no longer a matter of
growth and understanding within the developers, it is managerial or
political.  They may be under tight deadlines and so have to let
practices slip slightly, urged on by misinformed project managers.
Removing political obstacles is difficult and requires skill in
itself, but I think it's a tedious work compared to the personal
growth that developers must experience.

Willfully choosing not to write tests means you are stupid.

Pat


More information about the rspec-users mailing list