[Rspec-devel] shall vs. should

aslak hellesoy aslak.hellesoy at gmail.com
Mon Apr 24 20:35:03 EDT 2006


this is an old debate among bdd'ers. some people want 'must' and
'will' too. dan north, who is the 'father' of bdd uses should in his
jbehave framework (http://jbehave.codehaus.org/) as well as the
various texts he has written on the subject.

dan prefers the word behaviour, but the rspec crowd felt that
'specification of behaviour' is more appropriate - hence spec.

the way i see it, in our context, 'should' is significantly different
from 'shall'. i feel it is easier to say 'should' about something that
doesn't yet exist. 'shall' sort of implies the existence of the
subject - the thing that shall.

and that is precisely why i prefer should over shall. bdd is a design
technique, and we need a vocabulary that allows us to talk about the
not-yet-existent. shall, just like test, assumes the existence of the
subject, which is what we're trying to get away from.

aslak

On 4/24/06, Richard Kilmer <rich at infoether.com> wrote:
> Just a vocabulary nit, but if you are "specifying" behavior is it not
> correct to say this object shall do or not do something rather than
> should?  I mean, you are in a sense specifying something akin to a
> contract, and all contracts that I have worked on use shall to
> indicate that its required and not optional.
>
> context "An empty stack" do
>    specify "should accept an item when sent push" do
>      lambda { @stack.push Object.new }.should.not.raise
>    end
> end
>
> would it not be more correct in saying:
>
> context "An empty stack" do
>    specify "shall accept an item when sent push" do
>      lambda { @stack.push Object.new }.shall.not.raise
>    end
> end
>
> Its more proper to say "An empty stack shall accept an item when sent
> push".  That is contractual language, asserting an absolute
> requirement, and these specs are either met or not (there is no grey
> area).
>
> -rich
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>



More information about the Rspec-devel mailing list