Develop using behavior using existing software components

I am currently reading a beta version of Rspec: http://www.pragprog.com/titles/achbd/the-rspec-book

He describes the behavior-driven development cycle (red, green, refactor) as a small step in the development process. This means adding features one at a time.

My question is:

If I described one feature of my software (for example: a successful script for a user to enter a cucumber test) And if I used a modular component (for example, Devise) that has many functions (scripts). How could I follow behavior-driven methods? Once my first step has passed, I have to redesign my other tests to reflect the functionality of the software component that I use, thereby violating the BDD principle!

Edit (for clarity):

My first scenario goes after implementing Devise. But now I have to consider all my subsequent end tests (which I haven't written yet) around Devise behavior, and not the requirements of my members. Thus, the BDD cycle can no longer be applied. I have to reverse engineer Devise in my tests to get them to pass or not write tests.

+3
source share
2 answers

The BDD cycle includes creating scripts and then talking around these scripts to discover more that are missing, any misunderstandings, etc.

If you use a BDD tool such as Cucumber, you can record the scripts that you discussed.

Ideally, the scenarios will be in terms of high-level steps focused on the capabilities of the system and the value that they provide to users. They will not be registered or authenticated.

BDD . . , , . , . ? , ? , , ?

, , Devise. :

Given I have registered an account
When I <do this differentiating thing>
Then I <achieve this differentiating outcome>

.

+1

, : , , . :

Given a visitor is not logged in
When a visitor goes to the admin page
Then the visitor should see the login page

, , , . ? , Devise , , , . ? , , , /, . , , . , , .

?

+1

Source: https://habr.com/ru/post/1769065/


All Articles