http://www.mdpi.com/1999-5903/3/2/159/pdf
I haven't read the whole thing, but it's apparently about raising the level of abstraction in acceptance tests to what we've been calling the more 'declarative' style, and getting success from that.
What I think is interesting is that the more imperative steps still seem to be part of the framework, part of the 'tester's domain', just at a lower level. This is basically what we'd call nested steps. Robot framework also supports this. I wonder whether we should look to supporting nested steps more at the Gherkin level, and move away from allowing people to call them from Ruby code at all. Telling people to use Ruby methods (I'm looking at you Mr Premdas) is fine if they're comfortable writing Ruby code, but there are plenty of testers who would prefer to work in a more contained environment. I think there was a 'macros' ticket kicking around in lighthouse about this idea some time ago.
Thoughts?
cheers,
Matt
ma...@mattwynne.net
07974 430184
cheers,
Matt
ma...@mattwynne.net
07974 430184
--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cu...@googlegroups.com.
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
I understand your frustration with testers who seem mystified at the
suggestion that maybe it would be nice to be able to write even a
little bit of code, but I don't understand the strength of your
reaction to the article. It seems like a good explanation of the
problems at hand (brittle steps), and some possible ways to allow
testers themselves to address them. What's wrong with that?
Matt, how would macros in Gherkin look? I think I remember being not a
fan of the idea when it came up, but I can't remember any details.
Mike
My take on how this would be applied actually went down a different path - rather than allowing the automatic creation of nested scenarios (which is a large part of what I took the ZiBreve app described in the paper to do), I envisioned it as a Formatter similar to the one that shows unused step definitions. You could run it and it would identify places where you use the same steps repeatedly. It seems like this would be a useful way to get to more declarative scenarios. For example, if your spec was
When I see the dialog
And the dialog says "Foo"
And I click OK
And you used that repeatedly, the Formatter could identify that and say "These steps are frequently called together - perhaps they should be collapsed into a broader step" (or use language that's more clear to the user, of course). It seems like identifying these groups and having the users manually collapse them would be very likely to push things towards a more declarative format.
I actually really like this idea - once I get a team established and up and running, this may go on my to do list to see what I can build (assuming no one beats me to it :) ) Thanks for sharing the article, Matt!
(And as an aside, inline commenting is really annoying in Outlook - anyone have suggestions on better ways to get previous stuff quoted and make it clear what's new? (Other than the not helpful "Don't use Outlook" or "Use <XYZ>", of course? :) )
Here's the (relatively opaque) Robot framework documentation:
http://robotframework.googlecode.com/svn/tags/robotframework-2.5.6/doc/userguide/RobotFrameworkUserGuide.html#creating-user-keywords
In Robot, you can define them in their equivalent of a feature file, which scopes them to that feature. Or you can define them elsewhere and they're global. It would work something like this:
Feature: Wizard
Scenario: Wizard Step 2
Given I am on step 2 of the wizard
When I click "Next"
Then I should be on step 3
Macro: I am on step #{step_number} of the wizard
Given I have visited the wizard start page
And I have clicked "Next" #{step_number} times
The #{} notation allows you to capture a variable in the macro and then use it in the steps.
The nice thing about doing it at the Gherkin level like this, versus doing it in Ruby code, is that it's declarative. So you can look at some features and describe the mapping from high-level step to low-level steps without running the features.
cheers,
Matt
--
Freelance programmer & coach
Founder, http://relishapp.com
+44(0)7974430184 | http://twitter.com/mattwynne
That's a pretty cool feature I would probably never use myself! It
shouldn't be too hard to add a new keyword to Gherkin. Have you run
this past any QAs to see what they think of it? My impression from the
ML here is that it would be welcome, but that's just my impression.
Mike
> cheers,
> Matt
>
> --
> Freelance programmer & coach
> Founder, http://relishapp.com
> +44(0)7974430184 | http://twitter.com/mattwynne
>
Nope, I'm not coming across many day-to-day at the moment.
Are there any QAs readying this who would like to comment?
Pekka said his impression of Cucumber was that it was much more for developers, wheras Robot has been written by and for testers. I take Andrew's point, but I would like Cucumber to be as useful to as wide an audience as possible, as long as that doesn't mean making it unduly complicated.
> My impression from the
> ML here is that it would be welcome, but that's just my impression.
>
> Mike
>
>> cheers,
>> Matt
>>
>> --
>> Freelance programmer & coach
>> Founder, http://relishapp.com
>> +44(0)7974430184 | http://twitter.com/mattwynne
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Cukes" group.
>> To post to this group, send email to cu...@googlegroups.com.
>> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>
cheers,
Matt
ma...@mattwynne.net
07974 430184
Thanks, Matt. This could certainly lessen the troubles of a number of my colleagues. The example you provided looks like it was meant for Ruby. Is this feature also supported in Java (i.e., Cuke4Duke) ? And, if so, could you provide an example.
cheers,Matt07974 430184
On Thu, Jun 9, 2011 at 4:40 PM, Matt Wynne <ma...@mattwynne.net> wrote:On 8 Jun 2011, at 23:55, Robert wrote:
On Wednesday, June 8, 2011 8:06:59 AM UTC-7, mattwynne wrote:On 5 Jun 2011, at 20:15, Robert wrote:be of some help to the testers I know. Or, possibly, just more education on the pitfalls of using an imperative style might be of some use. My apologies if I've rambled a bit. Obviously, my ramblings are solely based on my experience as a tester, and are not reflective of the entire testing community.
Thanks for your contribution to the discussion, Robert.It's worth noting that you can already do this. You can call the #steps method from within a step definition, and pass it arbitrary gherkin steps to try to run:Given /I am on page 3 of the wizard/ dosteps %{Given I have completed page 1 of the wizardAnd I have completed page 2 of the wizard}endThere are maintainability problems with this approach, which are well documented on this list if you search the archives (for Nested Steps). But as a first step to help move away from imperative steps, it can be a great move.
Thanks, Matt. This could certainly lessen the troubles of a number of my colleagues. The example you provided looks like it was meant for Ruby. Is this feature also supported in Java (i.e., Cuke4Duke) ? And, if so, could you provide an example.
I'm afraid I don't know the answer to this. I expect there is a way, but I haven't used Cuke4Duke much. Can anyone help?Here is an example:Aslak