News for hackers. Stuff that matters.
Re:Cucumber: BDD Testing and Collaboration Tools by packetlost on Wednesday July 19, 2023 @04:02PM (#36792361)
I cannot overstate how much I detest BDD and Cucumber.
Re:Cucumber: BDD Testing and Collaboration Tools by DarkNova6 on Wednesday July 19, 2023 @04:11PM (#36792497)
What's wrong with BDD?

Admittedly, I never dealt with Cucumber.

Re:Cucumber: BDD Testing and Collaboration Tools by hitchstory on Wednesday July 19, 2023 @04:25PM (#36792689)
BDD is great as a concept but Cucumber/RSpec/Gherkin/Behave/etc. is an absolutely terrible DSL for implementing it:

* It's verbose.

* It's not type safe.

* It desperately needs some kind of inheritance - most user stories branch from other user stories (e.g. put product in shopping cart->purchase product) and the only way people who use it can deal with it is by concealing critical details in code or by writing massively repetitive stories.

* What other language has a parser that routinely asks you to write regexes to get things to parse?

None of these things are fixable and the creators have largely reacted to the complaints with gaslighting: "you're just using it wrong".

It can be used effectively if you align the stars correctly but mostly not.

The one thing it does get right is not being turing complete - there's clear value in not using code to describe scenarios.

Re:Cucumber: BDD Testing and Collaboration Tools by drewcoo on Wednesday July 19, 2023 @07:08PM (#36794781)
> Cucumber/RSpec/Gherkin/Behave/etc. is an absolutely terrible DSL

I wouldn't lump RSpec in with the rest of those.

Spec-style frameworks (like granddaddy RSpec) are terser. They don't have layers of indirection. They're intended to help devs think about how code will be used, not to make code look like English.

Re:Cucumber: BDD Testing and Collaboration Tools by packetlost on Wednesday July 19, 2023 @04:22PM (#36792655)
BDD is, IME, only really good for testing UI behavior (I've seen some pretty decent JS BDD testing frameworks, but have limitex xp with them). It can be good at that because those behaviors can usually be expressed well enough in natural language. But I've seen it shoehorned into data-centric UI-less applications that are just a massive pain to deal with. Half the point of most testing frameworks is getting more done with less typing/overhead, but Cucumber and BDD is sorta the exact opposite: do less with more typing by trying to describe complex concepts in natural language.

Cucumber mostly exists to upsell naive MBAs and project managers on their "pro" tools.

Re:Cucumber: BDD Testing and Collaboration Tools by dlahoda on Wednesday July 19, 2023 @04:08PM (#36792449)
why?

i know that 99% is badly written sure.

but bdd cucumber style testing if done right can be good. problem i saw people just incapable.

Re:Cucumber: BDD Testing and Collaboration Tools by ljm on Wednesday July 19, 2023 @04:18PM (#36792591)
“If done right” is carrying a lot of weight there.

I don’t mind it if you use cucumber and it still serves the purpose of describing your code’s behaviour, so the output is readable. RSpec’s documentation is a nice example of that.

The problem is if people just use it as a syntax over a webdriver, which means that your test behaviour and logic is arbitrarily split into two different languages, the cucumber output is useless, the tests are needlessly slow, and it’s really hard to debug. Cucumber itself is not able to add value there.

But that’s not unique to cucumber either. I don’t think many people realise that test writing and architecture is its own skill in programming and so many suites turn into write-only cludges that take 12 hours to run on a cluster of 50 CI workers.

Re:Cucumber: BDD Testing and Collaboration Tools by drewcoo on Wednesday July 19, 2023 @07:10PM (#36794797)
> The problem is if people just use it as a syntax over a webdriver

Cucumber and WebDriver? Two problematic frameworks does not equal a sane one.

Re:Cucumber: BDD Testing and Collaboration Tools by throwbadubadu on Wednesday July 19, 2023 @04:23PM (#36792672)
Aren't incapable people the norm and usual problem? ;D

Found it quite neutral, not too bad, but also not really helpful.. some nice ideas especially that cross functional collaboration, but in the end the engineers had overhead and hated to write the wrappers, and the other stakeholders still couldn't or didn't want to read/write docs/test, or however it was intended. Admitted, maybe I belong to that incapable crowd as well ;)