in reply to Behavior Driven Development: suggested tools for perl?
BDD strikes me as a variant of black box testing where the behavior of the "box" is defined using scenarios and language familiar to end users. The idea is to get end-users involved in the process of writing specs. Its chief advantage IMHO is expectation management: if the users are writing the tests, it is a lot harder for them to claim that the system doesn't do what they want it to do.
The problem I have with BBD is that its most vocal advocates seem to underestimate the difficulties in creating sound test suites. They sometimes argue as if talks with users are the only thing needed to focus the developer's attention and help them discover the "real API" (or at least the one that matters). I'm sure this true in part, but it isn't a substitute for good engineering and analysis. Users are a starting point for requirements, but not the ending point.
The "behaviors" most obvious to a user aren't always the most important for the long term stability of a system. If we limit testing to those scenarios we may have very unhappy customers 6 months down the road. Good test suites also need to handle things like boundary conditions that can only be found by analyzing the domains of inputs and calculating outputs. Story boarding simply isn't enough to get a full test suite. I find the claim that those non-user tests are low priority edge cases that no one cares about flimsy at best, especially since it is usually the non-obvious edge cases that end up as security vulnerabilities. Users don't always understand why they have to pay extra for tests they don't intuitively understand. But all that means is that part of our job as software engineers is to explain the value proposition behind the engineering side of development.
The situation is comparable to going to a doctor for a diagnosis. Sometimes patients have a good idea of what's wrong and a doctor would be very dumb to ignore the patients request that test X be carried out. Sometimes the patient is dead wrong, BUT the doctor knows that omitting that test will cause the patient to lose trust, so it gets done anyway. But which of us wants a doctor who only does the tests we ask? Or who makes us go through obscure tests whose value we don't understand?
That being said there are many CPAN modules for those interested in keeping tests close to user perceptions, API specs or in white box testing in general. Here is just a sampling:
All of these modules (CPAN links provided above) are part of distributions - to see the full list of modules in these packages, click on the distribution at the top of the CPAN link (the name with the dashes instead of ::).
Best, Beth
Update: clarification of role of users.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Behavior Driven Development: suggested tools for perl?
by Anonymous Monk on Apr 03, 2009 at 12:33 UTC | |
by ELISHEVA (Prior) on Apr 03, 2009 at 13:12 UTC |