SlideShare a Scribd company logo
1 of 21
Review of CucumberReview of Cucumber
Presented byPresented by
Jabeen Shazia IqbalJabeen Shazia Iqbal
CWID: 899287056CWID: 899287056
June 19, 2016June 19, 2016
Unit TestingUnit Testing
 The smallest testable part is called Unit, which has one or few inputs andThe smallest testable part is called Unit, which has one or few inputs and
mostly has single output.mostly has single output.
 It is required to validate these units whether the each unit of the softwareIt is required to validate these units whether the each unit of the software
performs as designed, Individual units/components of a software are testedperforms as designed, Individual units/components of a software are tested
 Perform White Box Testing.Perform White Box Testing.
 Developers perform this unit testing, but in some cases it may beDevelopers perform this unit testing, but in some cases it may be
performed by the independent software testers as well.performed by the independent software testers as well.
 The main purpose of this unit testing is to identify failures in the logicThe main purpose of this unit testing is to identify failures in the logic
and/or algorithms that helps to improve the quality of the code.and/or algorithms that helps to improve the quality of the code.
MotivationMotivation
→ To change or maintain the code, we would need moreTo change or maintain the code, we would need more
confidenceconfidence
→ Codes are often reusable.Codes are often reusable.
→ To make the development of the software fast.To make the development of the software fast.
Cont..Cont..
→ The cost of fixing of the defects detected in the Unit TestingThe cost of fixing of the defects detected in the Unit Testing
would be less comparative to the cost of fixing of defectswould be less comparative to the cost of fixing of defects
detected in another test such as system or acceptance testing.detected in another test such as system or acceptance testing.
→ Debugging becomes easy. When a Unit test fails, only theDebugging becomes easy. When a Unit test fails, only the
latest changes need to be debugged.latest changes need to be debugged.
→ Code after performing the unit testing is more reliable.Code after performing the unit testing is more reliable.
To perform Unit TestingTo perform Unit Testing
 1. Create a Test Plan1. Create a Test Plan -- Test Plan is the document which has theTest Plan is the document which has the
information about how the test will be performed, things to be tested, roles,information about how the test will be performed, things to be tested, roles,
responsibilities, test environment, activities involved etc.responsibilities, test environment, activities involved etc.

2. Create Test Cases and Test Data2. Create Test Cases and Test Data -- Test case and Test Data documentsTest case and Test Data documents
are prepared using the sample format the Organization is adopting. Testare prepared using the sample format the Organization is adopting. Test
Cases document will involve information such as Test case description,Cases document will involve information such as Test case description,
expected result, actual result, pass/fail, etc… Test Data document willexpected result, actual result, pass/fail, etc… Test Data document will
involve information such as the inputs required to be created for theinvolve information such as the inputs required to be created for the
specific function and condition, to perform the unit testing.specific function and condition, to perform the unit testing.

3. Write Test Scripts3. Write Test Scripts – If we going to automate the Test Cases, then– If we going to automate the Test Cases, then
writing Test Scripts may results in saving time that is requited for testingwriting Test Scripts may results in saving time that is requited for testing
Cont..Cont..
 4.Write the actual code4.Write the actual code- Code is developed in such a way that these test- Code is developed in such a way that these test
cases gets pass when executed.cases gets pass when executed.
 5.Once the code is ready to execute the test cases5.Once the code is ready to execute the test cases – Execution of the– Execution of the
Test Cases, written in the above 2nd step, will be performed on the writtenTest Cases, written in the above 2nd step, will be performed on the written
code.code.

6.Fix the bugs if any and re test the code6.Fix the bugs if any and re test the code - Result of the execution of- Result of the execution of
code will be captured. If the no error pops up, the codes are ready to go. Ifcode will be captured. If the no error pops up, the codes are ready to go. If
not, alter the code in such a way to remove the error/bug occurred duringnot, alter the code in such a way to remove the error/bug occurred during
execution. Once the code is updated, rerun the test cases on the updatedexecution. Once the code is updated, rerun the test cases on the updated
code to validate whether the result turns out to be pass.code to validate whether the result turns out to be pass.

7.Repeat the test cycle until the “unit” is free of all bugs7.Repeat the test cycle until the “unit” is free of all bugs - Tester need to- Tester need to
keep updating the code, if the error/bugs appears until there is no bugs inkeep updating the code, if the error/bugs appears until there is no bugs in
that specific module.that specific module.
CucumberCucumber
CucumberCucumber
 A testing framework driven by plain English textA testing framework driven by plain English text
 It supports all programming languageIt supports all programming language
 It behaves as a documentation and automatedIt behaves as a documentation and automated
teststests
Cucumber FormatCucumber Format
GherkinGherkin is the format for Cucumber Specifications. Technically speaking it is ais the format for Cucumber Specifications. Technically speaking it is a
small computer language with a well-defined syntax,small computer language with a well-defined syntax,
Feature:Feature: name of the feature goes herename of the feature goes here
Description:Description: Write the description of this feature in this field.Write the description of this feature in this field.
Scenario:Scenario: Acceptance criteria scenario goes here.Acceptance criteria scenario goes here.
GivenGiven
WhenWhen
AndAnd
ThenThen
Procedure to use CucumberProcedure to use Cucumber
Pre-requisite:Pre-requisite:
 RubyMine JetBrains – 30 Trial version is availableRubyMine JetBrains – 30 Trial version is available
 Install CucumberInstall Cucumber
Steps to play with cucumberSteps to play with cucumber
 Step 01: Open the RubyMine JetBrains.Step 01: Open the RubyMine JetBrains.
 Step 02: Create folder as “feature” and create two filesStep 02: Create folder as “feature” and create two files
 FilenameForGherkinScripts.featureFilenameForGherkinScripts.feature
 Step_definationStep_defination
 Step 03: Write the Gherkin Scripts in the .feature fileStep 03: Write the Gherkin Scripts in the .feature file
 Step 04: Run the .feature fileStep 04: Run the .feature file
 Step 05: Check the errors throwedStep 05: Check the errors throwed
 Step 06: Paste the Gherkin Scripts and Write the actual Ruby Code inStep 06: Paste the Gherkin Scripts and Write the actual Ruby Code in
the Step definitions filethe Step definitions file
 Step 07: Again run the .feature file, repeat the steps 05 and 07 until allStep 07: Again run the .feature file, repeat the steps 05 and 07 until all
errors the are cleared out.errors the are cleared out.
Cucumber ProcessCucumber Process
GherkinScriptGherkinScript
Step_definationsStep_definations
Step_definationsStep_definations
Procedure Cont..Procedure Cont..
 Run cucumber scripts again.Run cucumber scripts again.
 All steps, and therefore the entire scenarioAll steps, and therefore the entire scenario
should now be marked as “passed”should now be marked as “passed”
Merits of CucumberMerits of Cucumber
 This unit testing tool is the friendly and understandable by non technical userThis unit testing tool is the friendly and understandable by non technical user
 The Given-When-Then syntax of Cucumber scenarios imposes some structureThe Given-When-Then syntax of Cucumber scenarios imposes some structure
on scenarios while leaving plenty of room for teams to grow their ownon scenarios while leaving plenty of room for teams to grow their own
language to describe their systemlanguage to describe their system
 The style of writing test allows to reuse the gherkins scriptsThe style of writing test allows to reuse the gherkins scripts
 Predictability and improve the confidence among testers and developersPredictability and improve the confidence among testers and developers
 The separation of the three level of feature in the gherkin scripts makes itThe separation of the three level of feature in the gherkin scripts makes it
easier to reuse any part of the codeeasier to reuse any part of the code
 As we know that interaction of Business and IT is not quite good. ThisAs we know that interaction of Business and IT is not quite good. This
cucumber makes the bond stronger between them by mentioning thecucumber makes the bond stronger between them by mentioning the
customer’s executable specification to the team, helping them to be aware ofcustomer’s executable specification to the team, helping them to be aware of
the business goals in mind at all timesthe business goals in mind at all times
Cont..Cont..
 Automation in cucumber lets the specification updated in the gherkinsAutomation in cucumber lets the specification updated in the gherkins
scriptsscripts
 Automation leads to save the team from costly regressionAutomation leads to save the team from costly regression
 Even the reuse of code is possible, since we write the features inEven the reuse of code is possible, since we write the features in
separateseparate
 Supports other language as well beyond Ruby like Java, Scala, GroovySupports other language as well beyond Ruby like Java, Scala, Groovy
etc.etc.
 Quick and easy set up and executionsQuick and easy set up and executions
 Cucumber focuses on end-user experienceCucumber focuses on end-user experience
 Efficient tool for testingEfficient tool for testing
2.
Demerits of CucumberDemerits of Cucumber
 Extra code for converting the textual specification to Ruby codeExtra code for converting the textual specification to Ruby code
 OneOne more layer between test description and the code (you need tomore layer between test description and the code (you need to
make sure the code really matches the description)make sure the code really matches the description)
 Cucumber supports only web environmentCucumber supports only web environment
SummarySummary
 Cucumber follows Behavioral Driven DevelopmentCucumber follows Behavioral Driven Development
 First Business Analyst/Product Owner writes the Gherkin Scripts (inFirst Business Analyst/Product Owner writes the Gherkin Scripts (in
normal English), then we run the Gherkin script. Finally we write code tonormal English), then we run the Gherkin script. Finally we write code to
make this script passmake this script pass
 Cucumber supports all programming language not only RubyCucumber supports all programming language not only Ruby
ReferencesReferences
 Unit Testing,Unit Testing, http://softwaretestingfundamentals.com/unit-http://softwaretestingfundamentals.com/unit-
testing/testing/
 Steps to perform Unit Testing,Steps to perform Unit Testing,
http://www.exforsys.com/tutorials/testing/unit-testing.htmlhttp://www.exforsys.com/tutorials/testing/unit-testing.html
 Cucumber,Cucumber, https://cucumber.io/#whyhttps://cucumber.io/#why
 Procedure to perform cucumber and Pros/Cons,Procedure to perform cucumber and Pros/Cons,
http://www.slideshare.net/selvanathankapilan/cucumber-http://www.slideshare.net/selvanathankapilan/cucumber-
gherkin-languagegherkin-language
 Step by Step Procedure,Step by Step Procedure,
https://www.jetbrains.com/help/ruby/2016.1/creating-step-https://www.jetbrains.com/help/ruby/2016.1/creating-step-
definition.htmldefinition.html
Review of Cucumber Testing Framework

More Related Content

What's hot

Testing the untestable
Testing the untestableTesting the untestable
Testing the untestableRoyKlein
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG Greg.Helton
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questionsKuldeep Pawar
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiFlorent Batard
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++TestEngineering Software Lab
 
Unit Testing RPG with JUnit
Unit Testing RPG with JUnitUnit Testing RPG with JUnit
Unit Testing RPG with JUnitGreg.Helton
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentJohn Blum
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration TestingDavid Berliner
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) CodeOps Technologies LLP
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGLuca Minudel
 
Interpreter RPG to Java
Interpreter RPG to JavaInterpreter RPG to Java
Interpreter RPG to Javafarerobe
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDDDror Helper
 
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)Jen Wong
 
Code Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoCode Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoEvgeny Mandrikov
 

What's hot (19)

Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questions
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++Test
 
Unit Testing RPG with JUnit
Unit Testing RPG with JUnitUnit Testing RPG with JUnit
Unit Testing RPG with JUnit
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD)
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENG
 
RubyTesting
RubyTestingRubyTesting
RubyTesting
 
Interpreter RPG to Java
Interpreter RPG to JavaInterpreter RPG to Java
Interpreter RPG to Java
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
 
Code Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoCode Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCo
 

Viewers also liked

BDD with Cucumber-JVM - Nordic Testing Days 2016
BDD with Cucumber-JVM - Nordic Testing Days 2016BDD with Cucumber-JVM - Nordic Testing Days 2016
BDD with Cucumber-JVM - Nordic Testing Days 2016TSundberg
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsSkills Matter
 
Top 8 real estate property manager resume samples
Top 8 real estate property manager resume samplesTop 8 real estate property manager resume samples
Top 8 real estate property manager resume samplestonychoper5905
 
Top 8 nursing home manager resume samples
Top 8 nursing home manager resume samplesTop 8 nursing home manager resume samples
Top 8 nursing home manager resume samplestonychoper5905
 
La madre de los powerpoints
La madre de los powerpointsLa madre de los powerpoints
La madre de los powerpointsAlbert Colon
 
Automatic Data Validation and Cleaning with PySemantic
Automatic Data Validation and Cleaning with PySemanticAutomatic Data Validation and Cleaning with PySemantic
Automatic Data Validation and Cleaning with PySemanticJaidev Deshpande
 
FAN FILTER MOD NE FFU S 600
FAN FILTER MOD NE FFU S 600FAN FILTER MOD NE FFU S 600
FAN FILTER MOD NE FFU S 600harsh sonarkar
 
¿Por qué la humedad es mayor en zonas de vegetación?
¿Por qué la humedad es mayor en zonas de vegetación?¿Por qué la humedad es mayor en zonas de vegetación?
¿Por qué la humedad es mayor en zonas de vegetación?Jose Vicente Garcia
 
Automated Web Testing and Open Source Tools
Automated Web Testing and Open Source ToolsAutomated Web Testing and Open Source Tools
Automated Web Testing and Open Source ToolsHank Huang
 
Unidad 2: Nacionalismo y Populismo
Unidad 2: Nacionalismo y PopulismoUnidad 2: Nacionalismo y Populismo
Unidad 2: Nacionalismo y PopulismoBryan Ortiz
 
iYES Language Schoolのご紹介
iYES Language Schoolのご紹介iYES Language Schoolのご紹介
iYES Language Schoolのご紹介iYES Corporation
 
INFORMATION COMMUNECTION TECHNOLOGY
INFORMATION COMMUNECTION TECHNOLOGYINFORMATION COMMUNECTION TECHNOLOGY
INFORMATION COMMUNECTION TECHNOLOGYAbdul Qadir Khosa
 

Viewers also liked (20)

BDD with Cucumber-JVM - Nordic Testing Days 2016
BDD with Cucumber-JVM - Nordic Testing Days 2016BDD with Cucumber-JVM - Nordic Testing Days 2016
BDD with Cucumber-JVM - Nordic Testing Days 2016
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
E-Learning
E-LearningE-Learning
E-Learning
 
Brochure
Brochure Brochure
Brochure
 
Top 8 real estate property manager resume samples
Top 8 real estate property manager resume samplesTop 8 real estate property manager resume samples
Top 8 real estate property manager resume samples
 
Presentación de prueba
Presentación de pruebaPresentación de prueba
Presentación de prueba
 
Plan de negocio
Plan de negocioPlan de negocio
Plan de negocio
 
book ppt
book pptbook ppt
book ppt
 
Top 8 nursing home manager resume samples
Top 8 nursing home manager resume samplesTop 8 nursing home manager resume samples
Top 8 nursing home manager resume samples
 
Slideshare
SlideshareSlideshare
Slideshare
 
La madre de los powerpoints
La madre de los powerpointsLa madre de los powerpoints
La madre de los powerpoints
 
JOIN US!!!!
JOIN US!!!!JOIN US!!!!
JOIN US!!!!
 
Automatic Data Validation and Cleaning with PySemantic
Automatic Data Validation and Cleaning with PySemanticAutomatic Data Validation and Cleaning with PySemantic
Automatic Data Validation and Cleaning with PySemantic
 
FAN FILTER MOD NE FFU S 600
FAN FILTER MOD NE FFU S 600FAN FILTER MOD NE FFU S 600
FAN FILTER MOD NE FFU S 600
 
¿Por qué la humedad es mayor en zonas de vegetación?
¿Por qué la humedad es mayor en zonas de vegetación?¿Por qué la humedad es mayor en zonas de vegetación?
¿Por qué la humedad es mayor en zonas de vegetación?
 
Automated Web Testing and Open Source Tools
Automated Web Testing and Open Source ToolsAutomated Web Testing and Open Source Tools
Automated Web Testing and Open Source Tools
 
Unidad 2: Nacionalismo y Populismo
Unidad 2: Nacionalismo y PopulismoUnidad 2: Nacionalismo y Populismo
Unidad 2: Nacionalismo y Populismo
 
iYES Language Schoolのご紹介
iYES Language Schoolのご紹介iYES Language Schoolのご紹介
iYES Language Schoolのご紹介
 
INFORMATION COMMUNECTION TECHNOLOGY
INFORMATION COMMUNECTION TECHNOLOGYINFORMATION COMMUNECTION TECHNOLOGY
INFORMATION COMMUNECTION TECHNOLOGY
 
Capitulo 4 7
Capitulo 4 7Capitulo 4 7
Capitulo 4 7
 

Similar to Review of Cucumber Testing Framework

JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineAnup Singh
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbjeyasrig
 
Testing in Craft CMS
Testing in Craft CMSTesting in Craft CMS
Testing in Craft CMSJustinHolt20
 
Testing Software Solutions
Testing Software SolutionsTesting Software Solutions
Testing Software Solutionsgavhays
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and executionClemens Reijnen
 
Manual testing real time questions by subbu
Manual testing real time questions by subbuManual testing real time questions by subbu
Manual testing real time questions by subbupalla subrahmanyam
 
12 sdd lesson testing and evaluating
12 sdd lesson testing and evaluating12 sdd lesson testing and evaluating
12 sdd lesson testing and evaluatingMike Cusack
 
Manual testing interview questions
Manual testing interview questionsManual testing interview questions
Manual testing interview questionsBABAR MANZAR
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Applitools
 

Similar to Review of Cucumber Testing Framework (20)

Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblb
 
Testing in Craft CMS
Testing in Craft CMSTesting in Craft CMS
Testing in Craft CMS
 
Testing concepts
Testing conceptsTesting concepts
Testing concepts
 
Testing Software Solutions
Testing Software SolutionsTesting Software Solutions
Testing Software Solutions
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and execution
 
Why test with flex unit
Why test with flex unitWhy test with flex unit
Why test with flex unit
 
Tdd dev session
Tdd dev sessionTdd dev session
Tdd dev session
 
Manual testing real time questions by subbu
Manual testing real time questions by subbuManual testing real time questions by subbu
Manual testing real time questions by subbu
 
Automation using ibm rft
Automation using ibm rftAutomation using ibm rft
Automation using ibm rft
 
12 sdd lesson testing and evaluating
12 sdd lesson testing and evaluating12 sdd lesson testing and evaluating
12 sdd lesson testing and evaluating
 
Manual testing interview questions
Manual testing interview questionsManual testing interview questions
Manual testing interview questions
 
Types of testing
Types of testingTypes of testing
Types of testing
 
SE2011_10.ppt
SE2011_10.pptSE2011_10.ppt
SE2011_10.ppt
 
Application Testing
Application TestingApplication Testing
Application Testing
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
 

Review of Cucumber Testing Framework

  • 1. Review of CucumberReview of Cucumber Presented byPresented by Jabeen Shazia IqbalJabeen Shazia Iqbal CWID: 899287056CWID: 899287056 June 19, 2016June 19, 2016
  • 2. Unit TestingUnit Testing  The smallest testable part is called Unit, which has one or few inputs andThe smallest testable part is called Unit, which has one or few inputs and mostly has single output.mostly has single output.  It is required to validate these units whether the each unit of the softwareIt is required to validate these units whether the each unit of the software performs as designed, Individual units/components of a software are testedperforms as designed, Individual units/components of a software are tested  Perform White Box Testing.Perform White Box Testing.  Developers perform this unit testing, but in some cases it may beDevelopers perform this unit testing, but in some cases it may be performed by the independent software testers as well.performed by the independent software testers as well.  The main purpose of this unit testing is to identify failures in the logicThe main purpose of this unit testing is to identify failures in the logic and/or algorithms that helps to improve the quality of the code.and/or algorithms that helps to improve the quality of the code.
  • 3. MotivationMotivation → To change or maintain the code, we would need moreTo change or maintain the code, we would need more confidenceconfidence → Codes are often reusable.Codes are often reusable. → To make the development of the software fast.To make the development of the software fast.
  • 4. Cont..Cont.. → The cost of fixing of the defects detected in the Unit TestingThe cost of fixing of the defects detected in the Unit Testing would be less comparative to the cost of fixing of defectswould be less comparative to the cost of fixing of defects detected in another test such as system or acceptance testing.detected in another test such as system or acceptance testing. → Debugging becomes easy. When a Unit test fails, only theDebugging becomes easy. When a Unit test fails, only the latest changes need to be debugged.latest changes need to be debugged. → Code after performing the unit testing is more reliable.Code after performing the unit testing is more reliable.
  • 5. To perform Unit TestingTo perform Unit Testing  1. Create a Test Plan1. Create a Test Plan -- Test Plan is the document which has theTest Plan is the document which has the information about how the test will be performed, things to be tested, roles,information about how the test will be performed, things to be tested, roles, responsibilities, test environment, activities involved etc.responsibilities, test environment, activities involved etc.  2. Create Test Cases and Test Data2. Create Test Cases and Test Data -- Test case and Test Data documentsTest case and Test Data documents are prepared using the sample format the Organization is adopting. Testare prepared using the sample format the Organization is adopting. Test Cases document will involve information such as Test case description,Cases document will involve information such as Test case description, expected result, actual result, pass/fail, etc… Test Data document willexpected result, actual result, pass/fail, etc… Test Data document will involve information such as the inputs required to be created for theinvolve information such as the inputs required to be created for the specific function and condition, to perform the unit testing.specific function and condition, to perform the unit testing.  3. Write Test Scripts3. Write Test Scripts – If we going to automate the Test Cases, then– If we going to automate the Test Cases, then writing Test Scripts may results in saving time that is requited for testingwriting Test Scripts may results in saving time that is requited for testing
  • 6. Cont..Cont..  4.Write the actual code4.Write the actual code- Code is developed in such a way that these test- Code is developed in such a way that these test cases gets pass when executed.cases gets pass when executed.  5.Once the code is ready to execute the test cases5.Once the code is ready to execute the test cases – Execution of the– Execution of the Test Cases, written in the above 2nd step, will be performed on the writtenTest Cases, written in the above 2nd step, will be performed on the written code.code.  6.Fix the bugs if any and re test the code6.Fix the bugs if any and re test the code - Result of the execution of- Result of the execution of code will be captured. If the no error pops up, the codes are ready to go. Ifcode will be captured. If the no error pops up, the codes are ready to go. If not, alter the code in such a way to remove the error/bug occurred duringnot, alter the code in such a way to remove the error/bug occurred during execution. Once the code is updated, rerun the test cases on the updatedexecution. Once the code is updated, rerun the test cases on the updated code to validate whether the result turns out to be pass.code to validate whether the result turns out to be pass.  7.Repeat the test cycle until the “unit” is free of all bugs7.Repeat the test cycle until the “unit” is free of all bugs - Tester need to- Tester need to keep updating the code, if the error/bugs appears until there is no bugs inkeep updating the code, if the error/bugs appears until there is no bugs in that specific module.that specific module.
  • 8. CucumberCucumber  A testing framework driven by plain English textA testing framework driven by plain English text  It supports all programming languageIt supports all programming language  It behaves as a documentation and automatedIt behaves as a documentation and automated teststests
  • 9. Cucumber FormatCucumber Format GherkinGherkin is the format for Cucumber Specifications. Technically speaking it is ais the format for Cucumber Specifications. Technically speaking it is a small computer language with a well-defined syntax,small computer language with a well-defined syntax, Feature:Feature: name of the feature goes herename of the feature goes here Description:Description: Write the description of this feature in this field.Write the description of this feature in this field. Scenario:Scenario: Acceptance criteria scenario goes here.Acceptance criteria scenario goes here. GivenGiven WhenWhen AndAnd ThenThen
  • 10. Procedure to use CucumberProcedure to use Cucumber Pre-requisite:Pre-requisite:  RubyMine JetBrains – 30 Trial version is availableRubyMine JetBrains – 30 Trial version is available  Install CucumberInstall Cucumber Steps to play with cucumberSteps to play with cucumber  Step 01: Open the RubyMine JetBrains.Step 01: Open the RubyMine JetBrains.  Step 02: Create folder as “feature” and create two filesStep 02: Create folder as “feature” and create two files  FilenameForGherkinScripts.featureFilenameForGherkinScripts.feature  Step_definationStep_defination  Step 03: Write the Gherkin Scripts in the .feature fileStep 03: Write the Gherkin Scripts in the .feature file  Step 04: Run the .feature fileStep 04: Run the .feature file  Step 05: Check the errors throwedStep 05: Check the errors throwed  Step 06: Paste the Gherkin Scripts and Write the actual Ruby Code inStep 06: Paste the Gherkin Scripts and Write the actual Ruby Code in the Step definitions filethe Step definitions file  Step 07: Again run the .feature file, repeat the steps 05 and 07 until allStep 07: Again run the .feature file, repeat the steps 05 and 07 until all errors the are cleared out.errors the are cleared out.
  • 15. Procedure Cont..Procedure Cont..  Run cucumber scripts again.Run cucumber scripts again.  All steps, and therefore the entire scenarioAll steps, and therefore the entire scenario should now be marked as “passed”should now be marked as “passed”
  • 16. Merits of CucumberMerits of Cucumber  This unit testing tool is the friendly and understandable by non technical userThis unit testing tool is the friendly and understandable by non technical user  The Given-When-Then syntax of Cucumber scenarios imposes some structureThe Given-When-Then syntax of Cucumber scenarios imposes some structure on scenarios while leaving plenty of room for teams to grow their ownon scenarios while leaving plenty of room for teams to grow their own language to describe their systemlanguage to describe their system  The style of writing test allows to reuse the gherkins scriptsThe style of writing test allows to reuse the gherkins scripts  Predictability and improve the confidence among testers and developersPredictability and improve the confidence among testers and developers  The separation of the three level of feature in the gherkin scripts makes itThe separation of the three level of feature in the gherkin scripts makes it easier to reuse any part of the codeeasier to reuse any part of the code  As we know that interaction of Business and IT is not quite good. ThisAs we know that interaction of Business and IT is not quite good. This cucumber makes the bond stronger between them by mentioning thecucumber makes the bond stronger between them by mentioning the customer’s executable specification to the team, helping them to be aware ofcustomer’s executable specification to the team, helping them to be aware of the business goals in mind at all timesthe business goals in mind at all times
  • 17. Cont..Cont..  Automation in cucumber lets the specification updated in the gherkinsAutomation in cucumber lets the specification updated in the gherkins scriptsscripts  Automation leads to save the team from costly regressionAutomation leads to save the team from costly regression  Even the reuse of code is possible, since we write the features inEven the reuse of code is possible, since we write the features in separateseparate  Supports other language as well beyond Ruby like Java, Scala, GroovySupports other language as well beyond Ruby like Java, Scala, Groovy etc.etc.  Quick and easy set up and executionsQuick and easy set up and executions  Cucumber focuses on end-user experienceCucumber focuses on end-user experience  Efficient tool for testingEfficient tool for testing 2.
  • 18. Demerits of CucumberDemerits of Cucumber  Extra code for converting the textual specification to Ruby codeExtra code for converting the textual specification to Ruby code  OneOne more layer between test description and the code (you need tomore layer between test description and the code (you need to make sure the code really matches the description)make sure the code really matches the description)  Cucumber supports only web environmentCucumber supports only web environment
  • 19. SummarySummary  Cucumber follows Behavioral Driven DevelopmentCucumber follows Behavioral Driven Development  First Business Analyst/Product Owner writes the Gherkin Scripts (inFirst Business Analyst/Product Owner writes the Gherkin Scripts (in normal English), then we run the Gherkin script. Finally we write code tonormal English), then we run the Gherkin script. Finally we write code to make this script passmake this script pass  Cucumber supports all programming language not only RubyCucumber supports all programming language not only Ruby
  • 20. ReferencesReferences  Unit Testing,Unit Testing, http://softwaretestingfundamentals.com/unit-http://softwaretestingfundamentals.com/unit- testing/testing/  Steps to perform Unit Testing,Steps to perform Unit Testing, http://www.exforsys.com/tutorials/testing/unit-testing.htmlhttp://www.exforsys.com/tutorials/testing/unit-testing.html  Cucumber,Cucumber, https://cucumber.io/#whyhttps://cucumber.io/#why  Procedure to perform cucumber and Pros/Cons,Procedure to perform cucumber and Pros/Cons, http://www.slideshare.net/selvanathankapilan/cucumber-http://www.slideshare.net/selvanathankapilan/cucumber- gherkin-languagegherkin-language  Step by Step Procedure,Step by Step Procedure, https://www.jetbrains.com/help/ruby/2016.1/creating-step-https://www.jetbrains.com/help/ruby/2016.1/creating-step- definition.htmldefinition.html