[Rspec-devel] shall vs. should

aslak hellesoy aslak.hellesoy at gmail.com
Tue Apr 25 03:09:11 EDT 2006


On 4/24/06, Richard Kilmer <rich at infoether.com> wrote:
>
> On Apr 24, 2006, at 8:35 PM, aslak hellesoy wrote:
>
> > 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.
>
> Right, my initial thought of that was:
>
> archetype "An empty stack" do
>    behavior "should do blah" do
>    end
> end
>
> That is actually what you are doing, imagine an archetype for
> something that does not yet exist.  You are expecting the behavior to
> be such and such.
>
> Anyway, not hung up on the should vs. shall, just came to mind.
>
> from wikipedia:
>
> An archetype is an idealized model of a person, object, or concept
> from which similar instances are derived, copied, patterned, or
> emulated.
>

i like archetype. since several people have expressed a desire to use
a different vocabulary for bdd - and since ruby allows us to be
flexible - i'll throw up some docs on how to extend rspec to support
*your* words. -with a big warning to those who are inclined to use
'test', which means they missed the point ;-)

ps rich - any chance you could post a patch on rubyforge with some
tests for the should_this_and_that syntax? i'd like to explore it
further.

cheers,
aslak

> -rich
>
>
>
> >
> > 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