Post by k***@gmail.comRoberto,
I think I see where a misunderstanding lies.
I am experimenting with Gherkin to become a more useful tool for testing
as well as communication. One of the original purposes of Gherkin was
as an alternative to JUnit.
See https://dannorth.net/introducing-bdd/
âKen, did you notice the whole article written by Dan doesn't mention
Gherkin at all? Actually Gherkin was an addition to JBehave, it didn't
support Gherkin at the beginning... Nonetheless, if you look at JBehave
syntax, you'll find very quickly it does in fact have some common grounds
with JUnit (one above all, the After element), which is the main reason why
I'm not a fan of JBehave Story syntax... but that's more a personal taste
than anything.
Back on track, sorry for the diversion., I'll try to put two different hats
on my little head, just to word what I think are the two perspectives here.
As an experienced developer âI wouldn't pick Gherkin (or Cucumber) over
JUnit for testing not even if my only option would be JUnit version 1.0.0:
Gherkin is not a testing framework, nor is Cucumber, and if they were, they
would have been a very very poor one.â
âAs a business representative/product owner I couldn't care less if you
have tests behind a Gherkin file: all I would care is if the feature
described in the file accurately matches with what I need the software to
do. As a PO I've probably done that for years using Use Case Scenarios and
MS Word, but I would probably accept a different format if it can provide
the same or a better resultâ.
My opinion is Gherkin + Cucumber represent a decent bridge between these
two worlds, but it does provide the most of its value only if you walk this
bridge in one direction: from the specification to the tests.
What I am trying to say is that if your focus is on specifications and
requirements, than Gherkin can help you a lot in defining those in a manner
you can then decide what needs to be automatically tested, resolving the
need for validating the acceptance tests before the software gets into the
hands of the PO, who can get really frustrated by a failing software.
But if you are focused on testing than why use a language/framework which
doesn't even have an assertion structure? I mean, Cucumber by itself
doesn't even allow you to check if two strings are equal each other... And
I believe there is a good reason for the lack of those tools.
If my focus is on testing I would pick a testing framework and use it, like
JUnit, TestNG, etc... Something that helps me execute the checks I need to
perform to verify my assertions.
I perfectly understand the reasoning of Dan in his article and I've
personally partially experienced his very same frustrations during my
professional life, but I don't agree with you in summarizing it in
"Gherking (or JBehave, it doesn't really matter) was an alternative to
JUnit". My take from that article is the tool was intended to help you move
from TDD to BDD or, in other words, move from testing for the purpose of
verifying the code to checking the behaviour correctness.
It's a not a slight difference, but rather a huge leap: when we switch the
point of view, we also need to switch the language, stepping away from
computer programming and get our feet in the business language, the
language spoken by those who don't develop software.
Hence the natural language approach, hence the localization support and the
file format, hence the HTML reports: it must be readable and accessible to
people who don't have much of computer science in their DNA.
When we introduce pre-processor macros (#define and #include) we are
bringing this back into our programmer's lingo: sure, we can teach to our
business partners and product owners what #define and #include are and they
surely already understand tables, but is this what we should be doing?
Teaching them our geeky vocabulary?
I believe Gherkin and Cucumber aim at inverting this approach, letting the
business express their intentions using their own vocabulary, a vocabulary
that is finally shared between the parties.
Given I've signed up
I can log in
But only after I've confirmed my email address
Rather than
assertNotNull(username)
assertNotNull(password)
assertTrue(emailConfirmed)
assertEquals(username, storedUsername)
assertEquals(hash(password), storedPassword)
True, the above example is comparing potatoes and apples, I'm only trying
to express how distinct I see the world of testing from the world of
requirement specifications.
Post by k***@gmail.comTake a look at my Deliver Agile Session (you need to login as an agile
alliance member) https://lnkd.in/enCkUVf
âSorry, I'm not a member of such alliance, can't access it, but this
article on my blog
<https://rlogiacco.wordpress.com/2016/01/18/cucumber-is-not-a-testing-framework/>
is freely accessible.
â
Post by k***@gmail.comThere are two advantages:of using Gherkin
1.) The test is independent of the implementation. It specifies the
behavior of a unit.
2.) The test is readable by all members of the triad (customer, developer,
tester).
âI see... Your focus is on the tests. My take is differentâ:
1) the triad shares the same ubiquitous language
2) the specification is described in terms of what is needed, not on how it
has to be implemented (this is a very good match with Agile practices,
where you don't think on how things are going to be implemented beforehand,
but rather decide it when you start implementing)
3) The requirements are live and maintainable by all members of the triad
As I'm a plain user of Cucumber and not an agile guru or something, I can't
say my take is better than yours, but it's definitely very different: to
me, tests are far away from being the driver for Cucumber adoption.
Apologies for the length of my reply, I didn't realize it was so long
winded until I re-read it.
Thanks for the time,
Roberto
Post by k***@gmail.comKen
Post by Roberto Lo GiaccoPost by k***@gmail.comRoberto,
Thanks for your reply. We have different approaches to what a feature
file represents and how it is used. If a feature file does not contain
any data, then there is no need for this preprocessor, as you illustrated.
The more data one places in a feature file, then the possibility of values
that represent one domain term can be duplicated. Having #defines for
those terms can make for easier maintenance. In addition, giving names
to values helps create ubiquitous terms for understanding for the entire
team (e.g. MAXIMUM_VALUE).
I've found that having specific values in a scenario really helps in
discussion between the business and development. Using tables to contain
these values reduces the number of step definitions that need to be
created.
Background
Given the system is set up for with
| param | value |
| maximum | 200 |
| minimum | 50 |
| min length | 6 |
When the user inputs a value above the maximum allowed value
Then an error is shown
You should now question yourself: is what is written above a functional
requirement or a test? If your answer is the former within your context,
than you are ok. If it's the latter than why bother use Gherkin?
Post by k***@gmail.comAs far as CSV files, see my response to Halfordian Golfer.
My take on that is if I need a CSV to describe a business rule then that
business rule doesn't require Gherkin. I would also question myself why I
call "business rule" a CSV file and if I'm misinterpreting the concept of
business rule if I am thinking as a developer, trying to squeeze business
rules in a tabular format rather than trying to describe the business rule
for what it is... Does a table communicate better than natural language?
We, as software developers, are used to communicating in ways our business
partners do not understand, but if we don't treat Gherkin as a tool for
bridging communication between those two parties, why should we bother?
Regards,
Roberto
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to a topic in the
Google Groups "Cukes" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/cukes/F0AQ0DpVoZU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.