Behavior Driven Development(BDD)/Cucumber


Behavior Driven Development describes a cycle of interactions with well defined outputs, resulting in the delivery of working, tested software that matters. With BDD, you create executable specifications, not tests. You want to look at what your code does, not the internals of how it does it. This method of development is mainly about visualizing goals and aims at writing tests BEFORE writing the production code rather than testing all of the application code after its development.

If you focus on testing your classes, then the structure of your test code mirrors the structure of your production code. What happens when you re-factor and you change that structure? do you then re-write your tests? If you focus on behavior you don’t have to. When you re-factor, the behavior of your application doesn’t change. Get away from state-based testing. If you depend on specific variables in your code, the inner state of your application, it will be a barrier to re-factoring. Instead of focusing on assertions, set expectations. One of the frameworks which uses this style of Behavior Driven Development is the Cucumber framework.

Read More: Behavior Driven Development(BDD)/Cucumber

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s