[rspec-users] Spec'ing via features

Pat Maddox pergesu at gmail.com
Mon Nov 24 16:07:01 EST 2008


"Mark Wilden" <mark at mwilden.com> writes:

> On Mon, Nov 24, 2008 at 10:29 AM, Pat Maddox <pergesu at gmail.com> wrote:
>
>     I disagree with the part about edge cases.  Acceptance Tests are about
>     defining and verifying business value, and edge cases are supremely
>     valuable to businesses.  What happens when an ATM user tries to withdraw
>     $1 more than he has available in his account?
>
> Withdrawing $1 more than available is an edge case, vulnerable to an off-by-one error, and doesn't need to be shown to business, in my
> opinion. Testing that is a means of detecting errors - it's not a specification.

I respectfully disagree :)  In my hypothetical example, the
specification is what to do when someone withdraws more than they have
in their account.  Then when you write scenarios, the simplest thing you
can do to show that is the edge case itself, which is in fact valuable.
$1 over is (probably) the same as $100 over, and I think that $100
raises more questions than it answers.  Why is it $100?  Is there some
business rule that charges a penalty if they go $100 over the limit, but
not less?

Pat


More information about the rspec-users mailing list