SlideShare a Scribd company logo
Functional Testing of
RESTful Applications - Tools
and Techniques
October 2015
Nenad Bozic
@NenadBozicNs
SmartCat
www.smartcat.i
o
Why this presentation now
• Idea to do End-to-End tests is here for a long time (Selenium)
• Doing tests over presentation layer is hard
• Modern architecture separates client and server
• Servers with REST APIs ease up functional testing by skipping presentation
layer
Agenda
• Levels of tests
• Blackbox testing as monitoring tool
• Graybox testing as tool for external dependency control
• Bring functional tests closer to business with Cucumber
• Conclusion – tools and techniques overview
Levels of testing
• Unit testing
• Integration testing
• Component testing
• Blackbox
• Whitebox
• Graybox
• System testing
“There are generally four recognized levels of tests: unit testing, integration testing, component interface testing, and
system testing. Tests are frequently grouped by where they are added in the software development process, or by
the level of specificity of the test.” - Wikipedia
Blackbox testing as
monitoring tool
Blackbox testing as monitoring tool
Overview of the system and goal of test
Blackbox testing as monitoring tool
Challenge 1: Generate data
• Presentation from Gerard Meszaros was truly inspiring for our test data
• Hide test data in generators behind DSL
• Isolate data for easy cleanup
• Isolate data for testing in production
Blackbox testing as monitoring tool
Challenge 2: Overcome latency in system
• Microservice architecture is bringing latency problems
• Spring Retry – setup number of attempts with pause in between
Blackbox testing as monitoring tool
Challenge 3: Monitoring
• Save latest test result in memory
• Endpoint to fetch results of tests at any time
• Integration with Rollbar to log failed executions
• SMS/email notification strategy
Blackbox testing as monitoring tool
Result: Tests as monitoring tool in production
• Scheduled tests with isolated data run each 10 minutes
• Health check of 5 applications in production (Rollbar integration and SMS/email notification)
• Test runs accessible via endpoint
• idea for future to have GUI and history of test runs
• Idea for future to save duration of tests so we can compare runs
• Admins sleep better at night
Graybox testing as tool
for external dependency
control
Graybox testing as tool for external dependency control
Overview of the system and goal of test
Graybox testing as tool for external dependency control
Challenge 1: Mock external services
• Mock requests and provide controlled responses
• WireMock – library for stubbing and mocking web services
• Written in Java but provides a JSON API so you can use it with pretty much any language out there
• Application configuration challenges – use Spring Profiles to configure external URLs
• Local and functional environment use WireMock server
• Staging and production use real endpoints
Graybox testing as tool for external dependency control
Challenge 1: Mock external services
Graybox testing as tool for external dependency control
Challenge 2: Deployment flexibility
• WireMock has two ways of working:
• Standalone – configured via the Java API, JSON over HTTP or JSON files
• Library import – start server as part of the application
• WireMock is running and functional testing app sends rules and responses
Graybox testing as tool for external dependency control
Result: Fully tested flow with external dependencies before deployment
• Application is targeting WireMock instead of real external endpoints
• Functional testing application has controlled data which can be used for verification
• This approach can be used for internal dependencies as well
Bring functional tests
closer to business with
Cucumber
Bring functional tests closer to business with Cucumber
Why we decided to go with Cucumber
• Number of tests grew
• Code base of test application started to be hard to maintain
• Hard to group tests based on features
• Each person in the team had its own vocabulary and business perspective
• Our documentation got outdated faster and faster
Bring functional tests closer to business with Cucumber
Overview of Cucumber features
• You write scenarios and they are grouped in features
• Features can be tagged (@smoke-tests, @wire-mock)
• With @Before you can prepare environment for tests
• With @After you can do cleanup
• Everyone can write features which are translated to tests
• Dynamic documentation which is near code
Bring functional tests closer to business with Cucumber
Feature example
• Cucumber uses Gherkin notation (Given / When / Then)
• With Given you prepare application for test
• With When you issue command which will be tested
• With Then you state expected outcome
Given products CSV file for organization X
When CSV file is uploaded to FTP server.
Then the API call for organization X returns newly added products
Conclusion
Conclusion - tools and techniques overview
• Hint 1: try to organize data for testing directly in production
• Hint 2: use tools such as Spring Retry to overcome latency
• Hint 3: use tools such as WireMock to control dependencies
• Hint 4: use tools such as Cucumber to develop business language around
features
• Hint 5: schedule tests and leverage them as powerful monitoring tool
Links
• SmartCat Blog post - Blackbox testing microservices
• SmartCat Blog post - Graybox testing - Control your dependencies
• SmartCat Blog post - Bring functional tests closer to business with Cucumber
• Wikipedia testing levels in software
• Gerard Meszaros - Find the right abstraction for your tests
• Tools: Spring Retry, WireMock, Cucumber
Q&A
Thank you
Nenad Bozic
@NenadBozicNs
SmartCat
www.smartcat.i
o

More Related Content

What's hot

Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a Standard
Neotys_Partner
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
Melissa Benua
 
Building reliable web applications using Cypress
Building reliable web applications using CypressBuilding reliable web applications using Cypress
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
 
Continuous Integration on AWS
Continuous Integration on AWSContinuous Integration on AWS
Continuous Integration on AWS
Petar Petrov
 
Automated Testing in DevOps
Automated Testing in DevOpsAutomated Testing in DevOps
Automated Testing in DevOps
Haufe-Lexware GmbH & Co KG
 
Srivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to SuccessSrivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to Success
Neotys_Partner
 
Deploy and Destroy Complete Test Environments
Deploy and Destroy Complete Test EnvironmentsDeploy and Destroy Complete Test Environments
Deploy and Destroy Complete Test Environments
Bas Dijkstra
 
Putting Quality First through Continuous Testing
Putting Quality First through Continuous TestingPutting Quality First through Continuous Testing
Putting Quality First through Continuous Testing
TechWell
 
Micro Services - Small is Beautiful
Micro Services - Small is BeautifulMicro Services - Small is Beautiful
Micro Services - Small is Beautiful
Eberhard Wolff
 
The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...
The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...
The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...
C4Media
 
Operating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud MicroservicesOperating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud Microservices
Noriaki Tatsumi
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
Sencha
 
Software Architecture for DevOps and Continuous Delivery
Software Architecture for DevOps and Continuous DeliverySoftware Architecture for DevOps and Continuous Delivery
Software Architecture for DevOps and Continuous Delivery
Eberhard Wolff
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
Melissa Benua
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
Continuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisContinuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A Symbiosis
Eberhard Wolff
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
Sencha
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha
 
#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing
Derek Chan
 

What's hot (20)

Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a Standard
 
Test driven
Test drivenTest driven
Test driven
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
 
Building reliable web applications using Cypress
Building reliable web applications using CypressBuilding reliable web applications using Cypress
Building reliable web applications using Cypress
 
Continuous Integration on AWS
Continuous Integration on AWSContinuous Integration on AWS
Continuous Integration on AWS
 
Automated Testing in DevOps
Automated Testing in DevOpsAutomated Testing in DevOps
Automated Testing in DevOps
 
Srivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to SuccessSrivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to Success
 
Deploy and Destroy Complete Test Environments
Deploy and Destroy Complete Test EnvironmentsDeploy and Destroy Complete Test Environments
Deploy and Destroy Complete Test Environments
 
Putting Quality First through Continuous Testing
Putting Quality First through Continuous TestingPutting Quality First through Continuous Testing
Putting Quality First through Continuous Testing
 
Micro Services - Small is Beautiful
Micro Services - Small is BeautifulMicro Services - Small is Beautiful
Micro Services - Small is Beautiful
 
The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...
The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...
The Evolution of Testing Methodology at AWS: From Status Quo to Formal Method...
 
Operating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud MicroservicesOperating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud Microservices
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Software Architecture for DevOps and Continuous Delivery
Software Architecture for DevOps and Continuous DeliverySoftware Architecture for DevOps and Continuous Delivery
Software Architecture for DevOps and Continuous Delivery
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
 
Continuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisContinuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A Symbiosis
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing
 

Viewers also liked

жабаевнурсултан+автомойка+идея
жабаевнурсултан+автомойка+идеяжабаевнурсултан+автомойка+идея
жабаевнурсултан+автомойка+идея
Нурсултан Жабаев
 
THE NEW- REVERSE MORTGAGE
THE NEW- REVERSE MORTGAGETHE NEW- REVERSE MORTGAGE
THE NEW- REVERSE MORTGAGE
Bernie Ockrim
 
Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]
Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]
Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]hlombe dimbaza
 
Soql guide pour débutants
Soql guide pour débutantsSoql guide pour débutants
Soql guide pour débutants
Abdelhakim Mouttaqui ☁
 
Valores de la familia
Valores de la familiaValores de la familia
Valores de la familia
Luis Alvarado
 
Caso Nespresso-Marcas UCES
Caso Nespresso-Marcas UCESCaso Nespresso-Marcas UCES
Caso Nespresso-Marcas UCES
Ignacio Uman
 
Indice de gestion del cambio 2016 CEG 20160624
Indice de gestion del cambio 2016 CEG 20160624Indice de gestion del cambio 2016 CEG 20160624
Indice de gestion del cambio 2016 CEG 20160624
Zitec Consultores
 
Nestle Nespresso Bus 400
Nestle Nespresso Bus 400Nestle Nespresso Bus 400
Nestle Nespresso Bus 400
starsajeeb
 
Human Resource Management
Human Resource ManagementHuman Resource Management
Human Resource Management
Umair Shaikh
 
Resepi nasi ayam
Resepi nasi ayamResepi nasi ayam
Resepi nasi ayam
Jarayah Jais
 

Viewers also liked (10)

жабаевнурсултан+автомойка+идея
жабаевнурсултан+автомойка+идеяжабаевнурсултан+автомойка+идея
жабаевнурсултан+автомойка+идея
 
THE NEW- REVERSE MORTGAGE
THE NEW- REVERSE MORTGAGETHE NEW- REVERSE MORTGAGE
THE NEW- REVERSE MORTGAGE
 
Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]
Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]
Curriculum_Vitae-_HQL_DIMBAZA_updated[1][1]
 
Soql guide pour débutants
Soql guide pour débutantsSoql guide pour débutants
Soql guide pour débutants
 
Valores de la familia
Valores de la familiaValores de la familia
Valores de la familia
 
Caso Nespresso-Marcas UCES
Caso Nespresso-Marcas UCESCaso Nespresso-Marcas UCES
Caso Nespresso-Marcas UCES
 
Indice de gestion del cambio 2016 CEG 20160624
Indice de gestion del cambio 2016 CEG 20160624Indice de gestion del cambio 2016 CEG 20160624
Indice de gestion del cambio 2016 CEG 20160624
 
Nestle Nespresso Bus 400
Nestle Nespresso Bus 400Nestle Nespresso Bus 400
Nestle Nespresso Bus 400
 
Human Resource Management
Human Resource ManagementHuman Resource Management
Human Resource Management
 
Resepi nasi ayam
Resepi nasi ayamResepi nasi ayam
Resepi nasi ayam
 

Similar to Functional Testing of RESTful Applications

4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
hemasubbu08
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
Mihai-Cristian Fratila
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
Lohika_Odessa_TechTalks
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
ANKUR-BA
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
Sachin-QA
 
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
Postman
 
Introduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVTIntroduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVT
Cisco DevNet
 
software testing
 software testing software testing
software testing
Sara shall
 
Appmotives - Software Testing As Service
Appmotives - Software Testing As ServiceAppmotives - Software Testing As Service
Appmotives - Software Testing As Service
Kalyan Paluri
 
Introduction to the DevNet Sandbox
Introduction to the DevNet SandboxIntroduction to the DevNet Sandbox
Introduction to the DevNet Sandbox
Cisco DevNet
 
Laravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and ToolsLaravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and Tools
Muhammad Shehata
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing Process
Synerzip
 
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
Federico Toledo
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
DevOps.com
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
Mohammed Moishin
 
Srinivas_Selenium_3 Years_Resume
Srinivas_Selenium_3 Years_ResumeSrinivas_Selenium_3 Years_Resume
Srinivas_Selenium_3 Years_ResumeSrinivasa rao
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
Murageppa-QA
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
Rogue Wave Software
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
Preeti Mishra
 

Similar to Functional Testing of RESTful Applications (20)

4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
 
Introduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVTIntroduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVT
 
software testing
 software testing software testing
software testing
 
Appmotives - Software Testing As Service
Appmotives - Software Testing As ServiceAppmotives - Software Testing As Service
Appmotives - Software Testing As Service
 
Introduction to the DevNet Sandbox
Introduction to the DevNet SandboxIntroduction to the DevNet Sandbox
Introduction to the DevNet Sandbox
 
Laravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and ToolsLaravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and Tools
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing Process
 
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
 
Journey to the center of DevOps - v6
Journey to the center of DevOps - v6Journey to the center of DevOps - v6
Journey to the center of DevOps - v6
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Srinivas_Selenium_3 Years_Resume
Srinivas_Selenium_3 Years_ResumeSrinivas_Selenium_3 Years_Resume
Srinivas_Selenium_3 Years_Resume
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
 

Recently uploaded

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Functional Testing of RESTful Applications

  • 1.
  • 2. Functional Testing of RESTful Applications - Tools and Techniques October 2015 Nenad Bozic @NenadBozicNs SmartCat www.smartcat.i o
  • 3. Why this presentation now • Idea to do End-to-End tests is here for a long time (Selenium) • Doing tests over presentation layer is hard • Modern architecture separates client and server • Servers with REST APIs ease up functional testing by skipping presentation layer
  • 4. Agenda • Levels of tests • Blackbox testing as monitoring tool • Graybox testing as tool for external dependency control • Bring functional tests closer to business with Cucumber • Conclusion – tools and techniques overview
  • 5. Levels of testing • Unit testing • Integration testing • Component testing • Blackbox • Whitebox • Graybox • System testing “There are generally four recognized levels of tests: unit testing, integration testing, component interface testing, and system testing. Tests are frequently grouped by where they are added in the software development process, or by the level of specificity of the test.” - Wikipedia
  • 7. Blackbox testing as monitoring tool Overview of the system and goal of test
  • 8. Blackbox testing as monitoring tool Challenge 1: Generate data • Presentation from Gerard Meszaros was truly inspiring for our test data • Hide test data in generators behind DSL • Isolate data for easy cleanup • Isolate data for testing in production
  • 9. Blackbox testing as monitoring tool Challenge 2: Overcome latency in system • Microservice architecture is bringing latency problems • Spring Retry – setup number of attempts with pause in between
  • 10. Blackbox testing as monitoring tool Challenge 3: Monitoring • Save latest test result in memory • Endpoint to fetch results of tests at any time • Integration with Rollbar to log failed executions • SMS/email notification strategy
  • 11. Blackbox testing as monitoring tool Result: Tests as monitoring tool in production • Scheduled tests with isolated data run each 10 minutes • Health check of 5 applications in production (Rollbar integration and SMS/email notification) • Test runs accessible via endpoint • idea for future to have GUI and history of test runs • Idea for future to save duration of tests so we can compare runs • Admins sleep better at night
  • 12. Graybox testing as tool for external dependency control
  • 13. Graybox testing as tool for external dependency control Overview of the system and goal of test
  • 14. Graybox testing as tool for external dependency control Challenge 1: Mock external services • Mock requests and provide controlled responses • WireMock – library for stubbing and mocking web services • Written in Java but provides a JSON API so you can use it with pretty much any language out there • Application configuration challenges – use Spring Profiles to configure external URLs • Local and functional environment use WireMock server • Staging and production use real endpoints
  • 15. Graybox testing as tool for external dependency control Challenge 1: Mock external services
  • 16. Graybox testing as tool for external dependency control Challenge 2: Deployment flexibility • WireMock has two ways of working: • Standalone – configured via the Java API, JSON over HTTP or JSON files • Library import – start server as part of the application • WireMock is running and functional testing app sends rules and responses
  • 17. Graybox testing as tool for external dependency control Result: Fully tested flow with external dependencies before deployment • Application is targeting WireMock instead of real external endpoints • Functional testing application has controlled data which can be used for verification • This approach can be used for internal dependencies as well
  • 18. Bring functional tests closer to business with Cucumber
  • 19. Bring functional tests closer to business with Cucumber Why we decided to go with Cucumber • Number of tests grew • Code base of test application started to be hard to maintain • Hard to group tests based on features • Each person in the team had its own vocabulary and business perspective • Our documentation got outdated faster and faster
  • 20. Bring functional tests closer to business with Cucumber Overview of Cucumber features • You write scenarios and they are grouped in features • Features can be tagged (@smoke-tests, @wire-mock) • With @Before you can prepare environment for tests • With @After you can do cleanup • Everyone can write features which are translated to tests • Dynamic documentation which is near code
  • 21. Bring functional tests closer to business with Cucumber Feature example • Cucumber uses Gherkin notation (Given / When / Then) • With Given you prepare application for test • With When you issue command which will be tested • With Then you state expected outcome Given products CSV file for organization X When CSV file is uploaded to FTP server. Then the API call for organization X returns newly added products
  • 23. Conclusion - tools and techniques overview • Hint 1: try to organize data for testing directly in production • Hint 2: use tools such as Spring Retry to overcome latency • Hint 3: use tools such as WireMock to control dependencies • Hint 4: use tools such as Cucumber to develop business language around features • Hint 5: schedule tests and leverage them as powerful monitoring tool
  • 24. Links • SmartCat Blog post - Blackbox testing microservices • SmartCat Blog post - Graybox testing - Control your dependencies • SmartCat Blog post - Bring functional tests closer to business with Cucumber • Wikipedia testing levels in software • Gerard Meszaros - Find the right abstraction for your tests • Tools: Spring Retry, WireMock, Cucumber
  • 25. Q&A