News for hackers. Stuff that matters.
Re:How Secret Used Automated Testing for Their Android Launch by StavrosK on Friday May 01, 2015 @02:15PM (#9473437)
Can someone explain to me the appeal of Gherkin and other such tools? I don't see why the example on that page are anything but code that wants to "look better", and just ends up introducing another thing to maintain in your application.

How is writing a step in English and writing the English to translate it to code better than just writing the exact same steps in code to begin with?

Re:How Secret Used Automated Testing for Their Android Launch by Karunamon on Friday May 01, 2015 @03:07PM (#9473798)
Gherkin/Cucumber's big thing is that it lets the people who can't read code (i.e. project managers, suits, and customers) understand what's being tested. Usually along the lines of:

"As a user, I want to buy things, so I should be able to put things in the cart and get an accurate total price"

or

"As a user, I want to view the site in my own language, given I have come from a German network address, I should get the German language site"

This frees you from having to explain the finer points of cookies, or geoip, or any number of concepts to people who do not operate on a level that close to the bare metal.

The translation isn't really error prone either and isn't hard to implement from the programmer's side. Say that language example above? The actual test would be written like:

    As a user,
    I want to vew the site in my own language
    Given I have come from a German network address,
    I should get the german language site.
Those last two things are recognized via a verbatim regex (basically /^I have come from a German network address$/),

and the actual implementation code does something based on that, say, setting a test IP to a known German netblock, and the last line would actually load the site and look for the right localized strings.

So they're rather closely coupled together. If you change the wording of the test for whatever reason, the old code won't work anymore (actually, I think Cucumber will tell you that there was no test found), necessitating someone to actually verify that the test as written actually tests what the new requirements are.

Re:How Secret Used Automated Testing for Their Android Launch by thaumasiotes on Friday May 01, 2015 @03:24PM (#9473915)
> "As a user, I want to view the site in my own language, given I have come from a German network address, I should get the German language site"

I hate this philosophy so so much. If I wanted the German-language site I'd ask for it.

Re:How Secret Used Automated Testing for Their Android Launch by Karunamon on Friday May 01, 2015 @04:04PM (#9474139)
It's somewhat difficult to "ask for it" in a way that's accessible for a large number of people. Either way, you're presuming something that may or may not be true.

It's safest to handle the main use case, that is, people using the most prevalent language of the region, and implement a language chooser for everyone else.

Re:How Secret Used Automated Testing for Their Android Launch by thaumasiotes on Saturday May 02, 2015 @02:41AM (#9476135)
> you're presuming something that may or may not be true

What's that? I'm presuming that there's more than one language available, but so does the initial example.

Re:How Secret Used Automated Testing for Their Android Launch by Karunamon on Saturday May 02, 2015 @04:09PM (#9478387)
I mean no matter what you do, you're defaulting to a language that the user of your site may not speak.
Re:How Secret Used Automated Testing for Their Android Launch by thaumasiotes on Sunday May 03, 2015 @10:42AM (#9481441)
I don't consider it "unsafe", or problematic in any way, that http://en.wikipedia.org/ gets you English wikipedia even if you access it from a German IP, whereas http://de.wikipedia.org/ gets you German wikipedia even if you access it from an Australian IP. There are plenty of websites that will not give you the page you request no matter what you ask for, if they think you should be going to a different page. That's idiotic.
Re:How Secret Used Automated Testing for Their Android Launch by StavrosK on Friday May 01, 2015 @03:18PM (#9473879)
Thank you for the explanation. This doesn't sound like it really has any advantages over something like Dokku...