News for hackers. Stuff that matters.
Re:Testing isn't everything by rgoulter on Tuesday January 15, 2019 @04:09AM (#18909803)
> This is known as Behaviour-driven development (BDD).

FWIW, I'd say that "writing tests using a tool like RSpec/Cucumber/etc." isn't really "doing BDD" by itself. Tools like RSpec are a way of organising test code.

I'd recommend "Specification by Example". IIRC the idea is to come up with example output of a feature, refine this to a specification. Tools like RSpec help align the test code with the specification. https://gojko.net/books/specification-by-example/

> I think there are real problems with these BDD(-ish) test tools, as they obfuscate what you’re actually doing. ... The more layers you add on top of [assertions], the harder it will be to debug.

Sure, but the point of naming a test case (or adding in statements like `it("should ...")`) is to make it more apparent what a test is trying to do. I doubt that even something like Cucumber makes it that much harder to debug the program code. Executable Specifications also try to be 'living documentation', which (if it works out) is a benefit worth the added cost of writing the tests that way.

There are no comments on this comment yet.