Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Add "Example" keyword for Scenario #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moonmaster9000
Copy link

I'd like to be able to write "Example:" instead of "Scenario:".

It seems inconsistent that I can call the scenarios of a scenario outline "Examples", but I can't call a scenario itself "Example".

I'd also argue that the word "Example" has more obvious connotations than "Scenario" for a stakeholder new to cucumber - especially if they're already familiar with the process of "Specification by Example".

I'd like to be able to write "Example:" instead of "Scenario:".

It seems inconsistent that I can call the scenarios of a scenario outline "Examples", but I can't call a scenario itself "Example".

I'd also argue that the word "Example" has more obvious connotations than "Scenario" for a stakeholder new to cucumber - especially if they're already familiar with the process of "Specification by Example".
@jbpros
Copy link
Contributor

jbpros commented Oct 14, 2012

+1

We're doing specification by example, right?

Next step: specification as a synonym for feature? :)

@aslakhellesoy
Copy link
Contributor

@moonmaster9000 so people would be able to write:

Feature: ...
  Example: ...
    Given ...

  Example Outline: ...
    Given ...

    Examples:
      | .. | .. | 
      | .. | .. | 

That's a very heavy overloading of the word Example - 3 different keywords. I think that would be very confusing.

@diabolo
Copy link

diabolo commented Oct 15, 2012

-1 to proposal no need and confusing. Example is a generic term and can be applied to a number of things e.g.

Maths Problems

Examples:

So the argument that scenario outline -> examples is inconsistent is spurious, as is the argument that stakeholders can't comprehend 'scenario'.

@mattwynne
Copy link
Contributor

+1

I seem to remember @kevinrutherford sending a PR years ago with For example: as the keyword. I guess it never got merged in.

@aslakhellesoy
Copy link
Contributor

You who are +1 - what do you think about the triple overloading of Example? Not going to cause confusion?

@moonmaster9000
Copy link
Author

@aslakhellesoy

Does the current triple overloading of "Scenario" cause confusion? Currently you can write:

Feature: ...
  Scenario: ...
    Given ...

  Scenario Outline: ...
    Given ...

    Scenarios:
      | .. | .. | 
      | .. | .. |  

I just want to replace "Scenario" with "Example" for the reasons stated in my commit.

@mattwynne
Copy link
Contributor

@aslakhellesoy I personally use the words scenario and example interchangeably. I don't see what harm this would do. Just because the keywords are there, doesn't mean you have to use them.

@adzynia
Copy link

adzynia commented Oct 17, 2012

-1

When we are writing Acceptance Test that mean we write Scenario not an Example. I do not see any reasons to rename it

@moonmaster9000
Copy link
Author

Any chance of this getting merged?

@mattwynne
Copy link
Contributor

Any strong objections? Otherwise I suggest we JFDI.

@aslakhellesoy
Copy link
Contributor

If this change is worth its salt the people who adopt it will probably start talking about examples instead of scenarios.

Scenarios and Examples will be used interchangeably in gherkin, conversation, articles etc. I'm worried that this will cause confusion - especially to newcomers.

I do prefer "Specification by Example" and the vocabulary it uses over "Behaviour Driven Development" and its vocabulary, but not at the cost of confusing users about how to use Cucumber.

I think the ideal situation would be to remove Scenario* in favour of Example* across the board, but I think it's too late to do that, especially since we have 40 translations. Other tools (syntax highlighters and editors) will also have to catch up.

So while I agree with this change in principle I see far too many negative consequences.

If I merge this in I would like to do it with a BIG warning in the History/Changelog saying that this might be reverted in future release if it seems to be causing confusion. I guess knowing whether or not it does will become clear after a few months - monitoring forums, blog posts, tweets etc.

How does that sound?

@diabolo
Copy link

diabolo commented Nov 15, 2012

I really hate the idea of JFDI. Better would be to 'only do it if it makes things better'. In this case I think all the -1's and you're jfdi are telling you that at best its a marginal call.

All best

Andrew

Andrew Premdas
Manchester, UK


From: Matt Wynne [email protected]
To: cucumber/gherkin [email protected]
Cc: Andrew Premdas [email protected]
Sent: Thursday, 15 November 2012, 0:34
Subject: Re: [gherkin] Add "Example" keyword for Scenario (#200)

Any strong objections? Otherwise I suggest we JFDI.

Reply to this email directly or view it on GitHub.

@moonmaster9000
Copy link
Author

hi @aslakhellesoy, your proposal sounds reasonable to me. Looking forward to seeing how this plays out!

@hron84
Copy link

hron84 commented Nov 23, 2012

There is no way to contain both expression? Especially because the two word is interchangeable. So there is no way to support Scenario (to not break backward compatibility, and make -1 people more happy) and Example too?

@kumarharsh
Copy link
Contributor

-1

Aren't we over-complicating things?

It can cause a lot of confusion, especially since we are already using "Examples" to write the examples for the scenario outlines. It bugs me that we use "Scenarios" to give the examples to scenario outlines too, because the keyword "Scenario" is already there and serves a very different purpose.

  1. I understand that the aim of cucumber/gherkin is to make writing specs/requirements "AS EASY AS POSSIBLE", but I equating EASE with "satisfying each and every person's convenience" will be very very dangerous
  2. I think the stakeholders can understand "SCENARIO" and "EXAMPLES" in their present context just fine. On the other hand, if you write like this:
Feature:
        Example:
                Given
                When
                Then
                .
        Example Outline:
                .
                Examples:

it is bound to create confusion in their mind wrt the meanings of the two VERY DIFFERENT but seemingly same words Example and Examples mean.
PS: I'd also like to remove "Scenarios" from the synonyms of "Examples" which makes very less sense, but I guess that ship has sailed a long time ago.

Let's keep it as clean and unambiguous as possible.

@david
Copy link

david commented Apr 29, 2013

+1. To me, it's much easier to understand the concept of an "Example" over the concept of a "Scenario." Maybe my fault, but I only understood how to properly name examples when I started to mentally replace "Scenario" with "Example."

But given there is enough opposition to this, maybe there could be a "specification by example" translation that would be part of the official distribution, which would allow people to use it easily while keeping the "Scenario" default?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.