Hi Glenn.<br><br><div class="gmail_quote">On Nov 8, 2007 4:01 PM, Glenn Ford &lt;<a href="mailto:glenn@aldenta.com">glenn@aldenta.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It seems that what I&#39;m coming to understand of the direction of this<br>story concept is that there is a lot of emphasis being put on ensuring<br>we keep things at the business level. &nbsp;I can appreciate the elegance<br>
of it certainly, but when I think of what I would really want to gain<br>from this story-based testing process, I feel like it cuts out room<br>for some really cool ideas. &nbsp;Maybe you can help me see where they<br>would fit.
<br><br>I have in mind a scenario where a customer says &quot;I tried to log in and<br>it blew up!&quot; &nbsp;I take what they say with a business perspective and<br>check my story and say &quot;hey I&#39;ve got a login story and it works&quot; but
<br>that doesn&#39;t leave room for the fact that, slighty away from the norm<br>of the usual login procedure, this particular user clicked another<br>link in the middle of the process that changed some background<br>variable, breaking the process at the final login step. &nbsp;I would then
<br>want to write a story similar to the usual login, but with the ACTUAL<br>details of what the customer did to ensure I could duplicate, fix, and<br>then never have this problem creep up again.</blockquote><div><br>I completely agree.
<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> &nbsp;My story, in order to be<br>of use to me, would HAVE to have steps like &quot;click this button&quot;
<br>because, quite frankly, as a developer I find that&#39;s the sort of thing<br>that can break my code and so I would want a story to account for it.</blockquote><div><br>Yes, exactly. In this example, the UI domain <i>
is </i>the most useful domain to express the (bogus) behaviour, so it&#39;s the right thing to do. The scenario might be something like:<br><br><div style="margin-left: 40px;">Scenario: press the Explode button whilst filling in form
<br><br>Given I navigate to the <b>Submit order</b> page &nbsp; <i>[I&#39;m loving these infix parameters!]</i><br>And I set first name to <b>Dan</b> and second name to <b>North</b><br>When I click the Explode button<br>Then nothing should happen
<br>And the current page title should be <b>Submit order</b><br></div><br>Now, the whole of this scenario is in UI domain terms. It doesn&#39;t matter what business function I&#39;m trying to achieve here - the description is about some bogus behaviour in my implementation (the Explode button should be disabled whilst I&#39;m capturing data)
<br><br>So it&#39;s fine to express scenarios in either business domain terms to describe actual business flow, or UI terms to describe the user&#39;s interactions with the application. The confusion starts when you mix the two domains in the same story or at least in the same scenario.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>A user following my intended user-flow, then deviating in a way I<br>didn&#39;t predict. &nbsp;From the business end, they still followed the login
<br>process, they just had one little different quirk along the way.</blockquote><div><br>Yes, and it&#39;s that quirk <i>in this particular UI</i> that you want to capture with this scenario. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a way to get this kind of thing but still keep to the ideal<br>business perspective?</blockquote><div><br>You&#39;re trying to do a different thing here. The audience is different (probably a tester or UI designer rather than a business stakeholder) and they&#39;ll be using a different vocabulary.
<br>&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Would I just simply &quot;word&quot; it in a way that the<br>simple little thing they did had a business description? &nbsp;Or is that
<br>an indication that I have stupid things on my page that shouldn&#39;t even<br>be an option? &nbsp;Or is there a &quot;happy medium&quot; here as well between<br>business and ui perspectives of stories?</blockquote><div><br>
See above - as long as you keep the distinction between domains when you are describing a scenario, you&#39;ll probably be ok. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888">Glenn</font></blockquote><div><br>Cheers,<br>Dan<br>&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font color="#888888">
<br></font><div><div></div><div class="Wj3C7c"><br>On Nov 8, 2007, at 6:58 AM, David Chelimsky wrote:<br><br>&gt; On Nov 8, 2007 12:17 AM, Ben Mabey &lt;<a href="mailto:ben@benmabey.com">ben@benmabey.com</a>&gt; wrote:<br>
&gt;&gt; David Chelimsky wrote:<br>&gt;<br>&gt; &lt;snip&gt;<br>&gt;<br>&gt;&gt;&gt; ... the philosohy that Dan is<br>&gt;&gt;&gt; espousing: expressing stories in the business domain rather than the<br>&gt;&gt;&gt; UI domain (btw Dan, that was brilliantly put).
<br>&gt;&gt; What exactly do you and Dan mean when you say that the stories<br>&gt;&gt; should be<br>&gt;&gt; expressed in the business domain rather than the UI domain? &nbsp;(BTW, is<br>&gt;&gt; there a link to a Dan North post abou that?)
<br>&gt;<br>&gt; Sorry - there are two different threads going on about this topic<br>&gt; right now - the other one is on the rspec-devel list and that was<br>&gt; where Dan posted that statement:<br>&gt;<br>&gt; <a href="http://rubyforge.org/pipermail/rspec-devel/2007-November/004259.html" target="_blank">
http://rubyforge.org/pipermail/rspec-devel/2007-November/004259.html</a><br>&gt;<br>&gt; Keep in mind that User Stories are oft described as &quot;a token for a<br>&gt; conversation&quot;, and that even with acceptance criteria spelled out,
<br>&gt; whether the button says &quot;Create New Account&quot; or &quot;Enter&quot; is rarely of<br>&gt; sufficient business value to express that in a story. That&#39;s the sort<br>&gt; of detail that comes out when you say to your customer &quot;the entry form
<br>&gt; is done, why don&#39;t you come by so I can show it to you,&quot; as opposed to<br>&gt; in the iteration planning meeting.<br>&gt;<br>&gt; In the end it really does boil down to what the customer feels is<br>&gt; necessary in order to accept the software. If the customer really DOES
<br>&gt; care about what the button says, he or she may want that expressed in<br>&gt; a story. But even then, saying &quot;And I press Create New Account&quot; still<br>&gt; leaves things flexible enough so that you could be describing a web
<br>&gt; app, a GUI app, a touch-screen app, etc. The only thing this doesn&#39;t<br>&gt; work for would be a command line app. So maybe &quot;And I tell the system<br>&gt; to Create New Account&quot; would leave room for that as well. Or maybe,
<br>&gt; &quot;And I fold my arms and command the system to Create New Account.&quot; I<br>&gt; kinda like that one!<br>&gt;<br>&gt;&gt; From my understanding you<br>&gt;&gt; are saying that the steps that say &quot;user types in such and such&quot; and
<br>&gt;&gt; user &quot;hits the login button&quot; are too UI specific and don&#39;t really<br>&gt;&gt; have<br>&gt;&gt; much to do with the business domain. &nbsp;Is that correct?<br>&gt;<br>&gt; Unless the business IS software, like a text editor, yes.
<br>&gt;<br>&gt;&gt; I think that this is a part of writing stories that I am somewhat<br>&gt;&gt; struggling with, meaning how specific should these stories be in<br>&gt;&gt; explaining the view? &nbsp;At RubyConf during your presentation (great
<br>&gt;&gt; job,<br>&gt;&gt; BTW!) you mentioned how you like to spec out your views first.<br>&gt;<br>&gt; Ah - confusion. I DO like to spec my views first - when I get down to<br>&gt; the Spec Framework.<br>&gt;<br>&gt; In our example at RailsConf EU, we talked about a Cup Tracker (as in
<br>&gt; Rugby, which was going on at the time). Take a look at the example<br>&gt; story:<br>&gt;<br>&gt; <a href="http://rspec.rubyforge.org/svn/branches/railsconfeu2007/tags/chapter1/stories/plan_cup.rb" target="_blank">
http://rspec.rubyforge.org/svn/branches/railsconfeu2007/tags/chapter1/stories/plan_cup.rb</a><br>&gt;<br>&gt; This story really rides this whole line very nicely. We&#39;re describing<br>&gt; software that presents a view of something abstract, and we do so with
<br>&gt; some detail about what it presents - but there is nothing in it that<br>&gt; says &quot;when I click this button&quot; or &quot;when I enter this text.&quot;<br>&gt;<br>&gt; Now look at this version (same story, w/ the steps filled in):
<br>&gt;<br>&gt; <a href="http://rspec.rubyforge.org/svn/branches/railsconfeu2007/tags/chapter4/stories/plan_cup.rb" target="_blank">http://rspec.rubyforge.org/svn/branches/railsconfeu2007/tags/chapter4/stories/plan_cup.rb
</a><br>&gt;<br>&gt; Note how the implementations of the steps are starting to get into the<br>&gt; views. That&#39;s where that level of detail starts to play out.<br>&gt;<br>&gt; Now look at this:<br>&gt;<br>&gt; <a href="http://rspec.rubyforge.org/svn/branches/railsconfeu2007/tags/chapter4/spec/views/cups/show.rhtml_spec.rb" target="_blank">
http://rspec.rubyforge.org/svn/branches/railsconfeu2007/tags/chapter4/spec/views/cups/show.rhtml_spec.rb</a><br>&gt;<br>&gt; That spec was arrived at with the very granular red-green-refactor<br>&gt; process of TDD with a focus, naturally, on behaviour, design and
<br>&gt; documentation (It just occurs to me that behaviour, design and<br>&gt; documentation are B, D and D - interesting ...).<br>&gt;<br>&gt; Now some people look at that spec and scream &quot;holy crap - look at all<br>
&gt; the duplication - all that mocking - so brittle!.&quot; I won&#39;t disagree<br>&gt; that there is lots of duplication with other parts of the system, a<br>&gt; lot of mocking, and changes to the views would require changes to this
<br>&gt; spec (brittle). And, looking back at this, I might want to break that<br>&gt; spec up into more granular examples. While it speaks very well looking<br>&gt; at the code, running it would only tell you that &quot;/cups/show.rhtml
<br>&gt; should display the chart.&quot;<br>&gt;<br>&gt; But check this out! The implementation of that spec, with all that<br>&gt; mocking, IS the spec for the controller and model. That single spec<br>&gt; tells us about the structure that the model should expose (NOT the
<br>&gt; actual structure necessarily - just what it should expose to things<br>&gt; like views that want the models to be easy to use) and what the<br>&gt; controller should provide for the view.<br>&gt;<br>&gt; So this is all about discovery - starting from the outside and moving
<br>&gt; in. Implementing the steps that describe domain concepts help us to<br>&gt; discover some details of the views. Implementing the view specs help<br>&gt; us to discover the services we want from our controller and the APIs
<br>&gt; we want from our model. I find that to be very compelling.<br>&gt;<br>&gt; &lt;snip&gt;<br>&gt;<br>&gt;&gt; Where is the happy medium, in your opinion, between<br>&gt;&gt; keeping the stories concise and letting them drive every aspect of
<br>&gt;&gt; the<br>&gt;&gt; development? &nbsp;Maybe I am wrong in saying that the stories should<br>&gt;&gt; drive<br>&gt;&gt; EVERY aspect of the development?<br>&gt;<br>&gt; Well, they should drive every aspect, but not directly. You&#39;re not
<br>&gt; going to describe database table structure in your stories, but in the<br>&gt; end those structures end up as they do because of the stories.<br>&gt;<br>&gt;&gt;&gt;&gt; The Selenium integration is also an interesting idea that you
<br>&gt;&gt;&gt;&gt; might want<br>&gt;&gt;&gt;&gt; to read about if you haven&#39;t seen this post. &nbsp;I&#39;m still trying to<br>&gt;&gt;&gt;&gt; decided if using Selenium is worth the extra effort (my main goal<br>&gt;&gt;&gt;&gt; would
<br>&gt;&gt;&gt;&gt; be to test the JS during the acceptance tests)<br>&gt;<br>&gt; &lt;snip&gt;<br>&gt;<br>&gt;&gt;&gt; Generally speaking, in-browser tests tend to be incredibly brittle<br>&gt;&gt;&gt; and<br>&gt;&gt;&gt; run dog-slow. They simply have no choice but to be tied directly to
<br>&gt;&gt;&gt; low-level implementation details like html structure and element<br>&gt;&gt;&gt; IDs.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; So I&#39;d recommend only testing what you absolutely must in-browser.<br>&gt;&gt;&gt; But
<br>&gt;&gt;&gt; given our ajax-laden world, &quot;what you absolutely must&quot; may well turn<br>&gt;&gt;&gt; out to be a lot!<br>&gt;<br>&gt; &lt;snip&gt;<br>&gt;<br>&gt;&gt; I have heard that Selenium suites can become out of hand and end of
<br>&gt;&gt; being more hassle than what there worth. &nbsp;Thanks for the<br>&gt;&gt; recommendation,<br>&gt;&gt; I think that sounds like a sensible one.<br>&gt;&gt;<br>&gt;&gt; Thanks for taking the time to discuss this,<br>
&gt;<br>&gt; My pleasure!<br>&gt;<br>&gt; Cheers,<br>&gt; David<br>&gt;<br>&gt;&gt;<br>&gt;&gt; Ben<br>&gt; _______________________________________________<br>&gt; rspec-users mailing list<br>&gt; <a href="mailto:rspec-users@rubyforge.org">
rspec-users@rubyforge.org</a><br>&gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br><br>_______________________________________________
<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users
</a><br></div></div></blockquote></div><br>