The Should vs. Will debate; or why doubt is good

After a long discussion with Dan and other JBehave dev list members, I am reconvinced of the merits of the word “should”.

Dan’s argument went something like this:

  • In an agile environment, everything is mutable. Nothing is certain.
  • A test which boldly declares that something will have a certain behaviour is hard to delete. It feels as though actual functionality is being removed.
  • A test which suggests that something should have a certain behaviour is open to question. Should it? If the test fails, is it because there’s a bug in the functionality, or because the required behaviour is different? Perhaps the responsibility of the class has changed. Perhaps the behaviour is no longer required at all.
  • It’s easier to delete or modify “should” than it is to delete or modify “will”.
  • “Should” makes you question. “Will” makes you certain. Certainty is only good when combined with accuracy, otherwise it’s false assumption.
  • In an agile environment, it’s impossible to always be accurate about customer requirements (and therefore behaviour).

I think even Sam is showing signs of being convinced this time.

This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to The Should vs. Will debate; or why doubt is good

  1. anonymous says:

    Thought you might like to know that Apple’s Cocoa frameworks use a should/will/did convention so, for example, a Window will try to call its delegate’s shouldClose, willClose and didClose methods in that order.

    neil at ose-ltd dot com

  2. sirenian says:

    What does each of them do? I can understand “willClose” and “didClose”, but suspect that “shouldClose” might be better phrased as “mayClose”.

  3. anonymous says:

    shouldClose seeks permission from the delegate and returns a Bool.

    ‘mayClose’ sounds a bit like, ‘Well don’t count on me because I might not be here in a minute.

    Chopping semantics with may, should and will, etc. can go on all day. The great thing about the Cocoa convention is that now it’s established everyone knows what these qualifiers mean.


  4. sirenian says:

    Everyone? Or just Cocoa devs? 🙂

    If in doubt, comment the code. And yes, this is an argument which could go on all day. Thanks for telling me about the Cocoa convention; I’ll bear it in mind.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s