• Home
  • Testing
  • SAP
  • Web
  • Must Learn!
  • Big Data
  • Live Projects
  • Blog

In this tutorial, you will learn-

What is Behaviors Driven Development(BDD)?

Consider you are assigned to create Funds Transfer module in a Net Banking application.

There are multiple ways to test it

  1. Fund Transfer should take place if there is enough balance in source account
  2. Fund Transfer should take place if the destination a/c details are correct
  3. Fund Transfer should take place if transaction password / rsa code / security authentication for the transaction entered by user us correct
  4. Fund Transfer should take place even if it's a Bank Holiday
  5. Fund Transfer should take place on a future date as set by the account holder

The Test Scenario become more elaborate and complex as we consider additional features like transfer amount X for an interval Y days/months , stop schedule transfer when the total amount reaches Z , and so on

The general tendency of developers is to develop features and write test code later. As, evident in above case, Test Case development for this case is complex and developer will put off Testing till release , at which point he will do quick but ineffective testing.

To overcome this issue (Behavior Driven Development) BDD was conceived. It makes the entire testing process easy for a developer

In BDD, whatever you write must go into Given-When-Then steps. Lets consider the same example above in BDD

Given that a fund transfer module in net banking application has been developed
And I am accessing it with proper authentication
WhenI shall transfer with enough balance in my source account
Or I shall transfer on a Bank Holiday
Or I shall transfer on a future date
And destination a/c details are correct
And transaction password/rsa code / security authentication for the transaction is correct
And press or click send button
Then amount must be transferred
And the event will be logged in log file

Isn't it easy to write and read and understand? It covers all possible test cases for the fund transfer module and can be easily modified to accommodate more. Also, it more like writing documentation for the fund transfer module.

What is Cucumber?

Cucumber is a tool that supports Behavior Driven Development (BDD). It offers a way to write tests that anybody can understand, regardless of their technical knowledge.

Introduction to Cucumber

In BDD, users (business analysts, product owners) first write scenarios or acceptance tests that describes the behavior of the system from the customer's perspective, for review and sign-off by the product owners before developers write their codes.

Cucumber use Ruby programming language.

Advantages of Cucumber

  1. It is helpful to involve business stakeholders who can't easily read code
  2. Cucumber Testing focuses on end-user experience
  3. Style of writing tests allow for easier reuse of code in the tests
  4. Quick and easy set up and execution
  5. Efficient tool for testing

Cucumber vs Selenium vs ALM

In this section, we will study the difference between Cucumber, Selenium and UFT.

Cucumber

HP ALM (QTP)

Selenium

  • It is free
  • QTP is expensive
  • It is free
  • It's a behavior driven development tool
  • It's a Functional Automation Tool
  • It's a Functional and Performance ( Selenium Grid) test tool
  • Plugin in cucumber works faster
  • Plugin are slower compare to Cucumber and Selenium
  • Plugins are slower than cucumber
  • Cucumber Framework supports other language as well beyond Ruby like Java, Scala, Groovy etc.
  • QTP supports only VB script
  • Selenium supports Java, .Net and many other languages
  • Writing automation steps are joint effort of testers and developer
  • In QTP only tester writes automation steps
  • Like Cucumber Tool, writing automation steps are joint effort of testers and developer
  • Cucumber supports only web environment
  • Support web, desktop and any client server application
  • Supports only web environment

 

 

YOU MIGHT LIKE: