To make it speedy Cucumber gives an easy to write and coding interface.It is an iterative development and testing process where tests are written before real development of code of the real application. So in the initial phase, all tests are suppose to be failed but slowly, when developers start implementing the features, tests start passing.BDD is an extension of TDD. Cucumber or JBehave acts as a bridge between Business and Technical language.
Here is a nice link on BDD- https://www.atlassian.com/blog/software-teams/making-the-shift-to-behavior-driven-development
- Unit tests are code driven and actually produces code. Driven by Business value.
- Business drives the development via testing process that focuses on behavior rather than developed code.
- Refactoring improves the code and stability of the application
- Test first approach reduces the cost of bugs
- Simple Given,When and Then approach,so all stakeholders can design the feature of the application.It provides an easy colaboration between stakeholders,business analyst,QA team and developers.
- Free style English writing focuses on user experience. Easy to understand.
- Quick,Easy to setup and executable.
- Efficient tool for testing.
- User can provide example to clarify requirements.
- Tests become part of the maintenance overhead
- Tests needs to be rewritten when requirements change
- It targets the unit level coding rather than what the code should actually do
- Sometimes developer team find it waste of time if it is too poor.
Cucumber is a tool that can execute a plain text functional description as automation test.So cucumber is an acceptance testing tool but not an automation tool and Gherkin is an acceptance testing language.Cucumber acting as a bridge collaborates between stakeholders of the projects .Cucumber originally built in Ruby but currently supports java.
Cucumber needs the following jars:
Open Eclipse,Create a java Project, right click on the project , go to build path then configure build path and click on library lab and click on Add External jar, select cucumber jars to add. Click on Open to add the them to the project.
Add all selenium related jars in the same way to the project.
Now for setting up the project, we need to create two packages
source contains all of the source code coming from developers and test is going to hold all test classes and methods.