Yes, indeed, the mindset of BDD is slightly different from that of
TDD.  The primary objective is communication, even if it may come at a
cost of a little extra coding.  Mind you, one could say the same of TDD
... but because it's often only read by developers, it's a requirement
that sometimes goes by the way side.

That said, you can always have both Java steps methods (ie that are
mapped to textual steps) reuse a single private Java method that accepts
null as a value.  In that way, you achieve both goals:  clear
communication to stakeholders and avoid duplication of code in steps
classes.

Feel free to ask if you have any other questions.

Cheers

On 24/09/2010 08:01, sud wrote:
> Thanks for the suggestions. I ended up writing distinct steps for the
> null input and mapping them to distinct Java methods. It seems a
> little cumbersome from a developer standpoint, but like it was said,
> the story reads much more business friendly.
>
> You can tell I'm just beginning BDD and need to get my head out of the
> developer (ie Unit test) mind set.
>  
>
> ------------------------------------------------------------------------
> *From:* Mauro Talevi <[email protected]>
> *To:* [email protected]
> *Sent:* Thu, September 23, 2010 3:50:17 PM
> *Subject:* Re: [jbehave-user] using null as an parameter value
>
> I agree, using nulls is kind of an anti-pattern for me.  But there may
> be times that it can be necessary to use them,
> e.g. when using an API that requires them.
>
> On 23/09/2010 08:34, Clemens Wyss wrote:
> > I wouldn't put null into a user story. I'd use "<not set>" or
> "<n.a.>", or have an explicit expression "Given xyz is not set"
> >
> >> ----- Ursprüngliche Nachricht -----
> >> Von: sud
> >> Gesendet: 23.09.10 08:10 Uhr
> >> An: [email protected] <mailto:[email protected]>
> >> Betreff: [jbehave-user] using null as an parameter value
> >>
> >> I want to be able to supply null as a value to a String parameter
> in my step
> >> method. How do I do that?
> >>
> >> I tried null and it simply gets converted to a String "null".
> >>
> >> Thanks
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to