I believe behavioral tests are often called āgoldenā tests (as in gold standard). If you look at Hackage, there are various testing packages for such tests, such as tasty-golden
Would you be able to describe BDD in your own words?
At my workplace, BDD is synonym with specifying the behavior of software (inputs and expected outputs) separately from the software itself, usually in some structured files (e.g. YAML). In this way, the behavior of software can be specified before any software is actually written.
The package you have linked (chuchu) appears to be doing this in an embedded domain-specific language:
Given ā initial state;
When ā test inputs;
Then ā expected outputs.
Is an embedded domain-specific language a requirement for you?
Thanks for the explanation. Weāve apparently been using our own version of Gherkin, but Iām not aware of something you can use off-the-shelf in Haskell.
Gherkins make you write tests in a total different way from Hspec.
It is supposed to look like natural language and itās designed to be used by non-developpers.
Also, it allows you check successive steps of the same test (without reexecuting from the beginning each time), which corresponds to nested it (Iām not sure if Hspec allows it).
In practice it becomes quickly a pain and you indeed approximate it with Hspec and make your own testing eDSL.
IMO, the philosophy at the core of BDD is essentially just āwrite readable testsā. Which is an admirable goal, and probably more achievable in Haskell than in most languages since, as we know, itās great for writing EDSLs.
Having been forced to use Cucumber/Gherkin specifically once in the past, Iām very skeptical about its utility. There are endless Hacker News threads about why it doesnāt really work out in practice. And this Haskell Cafe thread always amuses me, even if you could argue it misses the point slightly.
I guess it depends on what you want to get out of it. My experience with ānatural languageā is that itās not particularly clear to most people.
I imagine you donāt need much explanation to get a non-programmer reading a (pendingād out) hspec test or to read the output of the test run, but getting a non-programmer to write any cucumber tests is pretty much a non-starter.
So any realistic goal I can imagine here is achievable with hspec.
That said, I donāt like writing tests in this form anyway. It seems to be formalizing something I donāt care as much about.
I agree with you and in my experience, Guerkins is terrible. I was just pointing that is what the OP seem to be looking for (regardless of whether it is a good idea or not).