4. What is TDD?
• TDD is an innovative software development approach where tests are written,
before writing the bare minimum of code required for the test to be fulfilled.
5. Advantage of TDD over Traditional Approach
• In the traditional development approach first, you select a user story, then
develop it, run tests over it and refactor the code until the test is passed. In this
method, the coding is done before testing. The disadvantage of using this
approach is that you are unable to discover the errors or missing cases until the
functionality has been fully developed.
• With TDD, you write tests upfront for functions that doesn’t yet exist. You know
that the test will certainly fail at the start, but minimal incremental coding at
each stage will make sure it will eventually pass at some point. So, this process
makes sure you won’t miss any scenarios once the functionality is fully finished.
6. What is BDD?
• BDD Stands for Business Driven Development.
• Behavioral Driven Development (BDD) is a software development approach that
has evolved from TDD (Test Driven Development) but differs by being written in
a shared language, which improves communication between tech and non-
tech teams and stakeholders.
7. What is Cucumber?
• Cucumber is the open source tool that is used by the Industry to test software.
• Cucumber is a high-level testing framework that supports behavior driven
development (BDD).
• Cucumber is a way of taking features, which is the combination of scenarios
written in plain English language using a simple grammar defined by a language
called gherkins.
8. What is Cucumber?
• The Feature File is then share between developers, tester, business analyst,
product owner.
Features
- Scenarios
- Steps
- Gherkins
Glue Code
- Step Definition
- Ruby
- java
- C#
Application
9. Gherkin,Feature,Scenario,FeatureFile
• So we gather features from user and write them down using gherkin language
in feature file.
• Features is the combination of the Scenario.
10. Gherkin Language
• Gherkins is the language that cucumber understands, it is a business Readable,
domain specific language that lets you describe software behavior with out
detailing its implementation.
• Gherkins serves two purposes- Documentation and automated testes.
• Single Gherkin source file contains a description of a single feature. Source files
have .feature extension.
11. Feature
• It can be defined as a standalone unit or functionality of a project.
• Ex Login Functionality
• One Feature File contain many scenario.
12. Scenario
• Scenario is one of the most important part of the Cucumber.
• Scenario is just like test case.
• Ex:Successful Login
13. How to write Scenario?
• We can write the scenario using GIVEN,WHEN THEN and AND.
• Given When THEN and AND are Cucumber nomenclature.
14. GIVEN,WHEN,THEN & AND
• GIVEN: we used GIVEN for any prequestie.
Ex:GIVEN user is in the login page
• WHEN:It is like an trigger point.
Ex:WHEN user enter the correct username and password
• THEN:It describe what the output should be.
Ex:THEN user should login successful
• AND:It provide the logical AND operation.
Ex:AND user enter the correct password
15. Example of the Feature File
Feature: Login Profile
Scenario: Successful login
When I fill in "Username" with "Test"
And I fill in "Password" with "123"
And I click on the "Log In" button
Then I am on the "My profile" page on URL "www.mycompany.com/myprofile"
And I should see "Welcome to your profile" message
And I should see the "Log out" button
18. What we have covered till now?
Your Project
Features
Scenarios
Steps
Step Definitions
Support Code
Automation Library
Your System
Business
Facing
Technical
Facing