I love BDD's approach to development, but I ran into the problem of how far to go. This comment from ThoughtWorks recent Radar pauses me:
“The advent of behavior-based models (BDDs) such as Cucumber, combined with browser automation tools such as Selenium, have contributed to the widespread use of browser-level acceptance testing. Unfortunately, this has spurred most testing, where the cost to run the tests is the most Instead, we should test at the appropriate level as close as possible to the code so that the tests can be performed with maximum efficiency. Level tests at the browser level should be icing cake and supported acceptance and unit tests, performed at the appropriate levels. "
So here is my script (pun intended):
I have a basic CRUD application with business requirements for filtering the displayed data based on criteria that the end user can select. For convenience of discussion, let me say that this application is for the energy company, and I show the current energy use per month for each client. The user of this application can narrow the data by selecting one client, several clients, clients or "All clients". The data displayed will vary depending on what they choose.
For the interested party to the product, they really represent 4 separate scenarios. However, from the point of view of the developer, they are almost identical, with the only difference being that the parameter is transferred to the database. Thus, the question arises: does the permutation of each permutation exceed the costs of its operation and maintenance?
I think the principles of BDD are likely to say yes, because the message of the expected behavior is more explicit, but I'm not sure. This, of course, makes me feel overkill. Scenarios are likely to have many copies with a few changes.
My tendency is to cover this functionality with one scenario that captures the core business value ("when I select a client, I see energy usage data"), and then covers other permutations with a set of non-UI-based integration that Confirm that the service / request returns the correct data. It is not right? What is the best answer to make sure these scenarios are covered without giving up on the benefits of BDD?