First of all we should define BDD (Behavior Driven Development) and how to distinguish it from TDD (Test Driven Development). TDD is - an approach, which basically means writing module tests for application. The tests are created before the code is written, and this is an obstacle for some developers, because testing something non-existent is difficult. BDD is development technic that is widely used in Agile along with TDD. It is based on behavioral system’s aspects, while TDD is based on implementation aspects. While using the BDD we reduce to minimum possibility of misunderstanding among users, developers and business-analytics. We can achieve this by creating Executable Scenarios (scenarios described in the specifications are translated into executable tests). BDD is neither new nor revolutionary, it is just a farther evolution of TDD-approach, where instead of “test” we use “must” word. Leaving words aside, we can expect using term “must” more naturally than “test” in implementation process. If we think in terms of “functionality”, this would lead us to classes, written for specification validation and could be the efficient implementation instrument. Let’s go back to UserStory template. Its classical representation is as follows: As a [1] I want [2] so that [3] where [2] – functionality, [3] – benefit, supported by [2], [1] – person, who achieves this benefit. The value of current approach lies in possibility to eliminate misunderstandings, both from developers’ and analytics’ side, regarding concrete system’s features and components. To define whether system behavior is correct or not, we introduce so-called history’s approve criteria. This pattern should be flexible enough to stay uncomplicated for users and analytics but still well-structured enough to be dividable into the parts. For this template, we can use the next form: (Given) set of Pre-conditions, (When) when an event occurs, (Then) outcome is achieved. Let’s look at such example: Given: I am an admin user When: I entered my credentials And pressed “Enter” button Then I should be logged in And see the admin page Scenarios, implemented according to this template could be used as test-cases. Moreover, the main advantage of this approach is easy-to-read format, not only for technicians, but also for users, busyness-analysts, testers and managers and thus helps to improve the understanding-level. World around us is moving forward very quickly. Spheres of business and development have need of direct communication more often. BDD is the approach that helps them find common language. In the next article, we will examine Specflow - .net project for implementing scenarios, described earlier.
23.4.2014
2 min read
BDD. SpecFlow & Watin. Part I
Looking for a tech partner to help you scale your project?
Let’s schedule a quick call to explore how we can support your business objectives.

Let’s schedule a quick call to explore how we can support your business objectives.
Christina Berko
Client Manager
Get new articles from Binary in your inbox!
Featured Case Studies
-
LEGAL TECH
Fundraising platform
Fundraising platform for political campaigns, featuring customizable campaign pages, one-click donations, and payment integrations.
Ruby, PostgreSQL, HTML, CSS, JavaScript
-
FINANCE
Intuitive forex currency trading at your fingertips
Highly performant mobile app which allows users to place trades quickly and easily on the Forex currency market.
React Native, JavaScript, Redux, Java, Objective-C
-
FINTECH
Real estate P2P lending company
Property investment platform with mobile app allowing users to make investments, track returns, and manage accounts with enhanced security features.
Laravel, PHP, React, React Native