SlideShare a Scribd company logo
W15
Testing Web Services
10/18/2017 3:00:00 PM
Testing RESTful Web Services
Presented by:
Hilary Weaver-Robb
Quicken Loans
Brought to you by:
350 Corporate Way, Suite 400, Orange Park, FL 32073
888-­‐268-­‐8770 ·∙ 904-­‐278-­‐0524 - info@techwell.com - https://www.techwell.com/
Hilary Weaver-Robb
Quicken Loans
Hilary Weaver-Robb is a software quality architect at Detroit-based Quicken
Loans. She is a mentor to her fellow QA team members, makes friends with
developers, and helps teams level-up their quality processes, tools, and
techniques. Hilary has always been passionate about improving the relationships
between developers and testers, and evangelizes software testing as a
rewarding, viable career. She runs the Motor City Software Testers user group,
working to build a community of quality advocates. Hilary tweets (a lot) as
@g33klady, and you can find tweet-by-tweet recaps of conferences she's
attended, as well as her thoughts and experiences in the testing world, at
g33klady.com.
9/6/2017
1
TESTING RESTFUL WEB SERVICES Hilary Weaver-Robb
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
WHO DIS
Hilary Weaver-Robb
SQA Architect, Quicken Loans - Detroit
@g33klady
G33klady.com
Github.com/g33kladyGithub.com/g33klady
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
2
OBJECTIVE
What a Web service is
What makes a Web service RESTful
Why we should test Web services
How to test RESTful Web services
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
WHAT IS A WEB SERVICE?
A Web service is a method of communication between two electronic devices over
a network.
It is a software function provided at a network address over the Web with the
service always on as in the concept of utility computing.
The W3C defines a Web service generally as: a software system designed to
support interoperable machine-to-machine interaction over a network.
- Wikipedia
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
3
WHAT IS A WEB SERVICE?
A website provides information consumable by humans
A web service provides information consumable by software
- A genius on StackOverflow
All Web services are APIs, but not all APIs are Web services
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
WHAT MAKES A WEB SERVICE RESTFUL?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
4
WHAT IS REST?
A way for systems to talk to one another (not always Web services)
REST stands for REpresentational State Transfer
Constraints:
 Uniform Interface
 Stateless
 Cacheable
 Client-Server
 Layered System
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
WHAT MAKES A WEB SERVICE RESTFUL?
Client-Server architecture using HTTP protocol
 Client sends Request to Server
 Server sends Response back
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
5
WHAT MAKES A WEB SERVICE RESTFUL?
URL tells you what you’re working with and doing
Messages can be lightweight (even just the URL!)
CRUD operations using HTTP methods
 Create/Update data (POST, PUT)
 Read data (GET)
 Delete data (DELETE)
WAY easier to test than non-RESTful services
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
COMPARISON
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
6
HTTP RESPONSE CODES
200s – OK!
400s – What you’re asking for, we can’t do
500s – Should only be uncontrollable circumstances
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
WHY SHOULD WE TEST WEB SERVICES?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
7
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
WHY TEST WEB SERVICES?
Usually complete before UI is even started
Validate the ductwork
UI can pull in multiple Web services
Because it’s code!
Integration Tests
UI Tests
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
Unit Tests
9/6/2017
8
HOW CAN I TEST RESTFUL WEB SERVICES?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
HOW CAN I FIGURE OUT WHAT TO TEST?
Documentation
Swagger
WADL/WSDL
RAML (RESTful API Modeling Language)
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
9
HOW CAN I FIGURE OUT WHAT TO TEST?
Check out the code
 Controllers
 Models
 Tests
Run web debugger and follow the calls
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
HOW CAN WE TEST WEB SERVICES?
Manual Testing Tools
 Postman
 Fiddler
 Advanced REST Client
 ReadyAPI (SoapUI)
 Swagger
Automation Tools
 Postman
 ReadyAPI
 Most unit testing frameworks
Swagger
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
10
WHAT TYPES OF TESTS CAN WE PERFORM?
Smoke tests
CRUD tests
Boundary
Required Fields
Field Type
Error ConditionsError Conditions
Security
Performance
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
LET’S DO SOME TESTING!
Gitter API
 GitHub chat
 https://gitter.im
 Interact with rooms, users, and messages
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
11
MESSAGES RESOURCE SPECS
List messages
 GET https://api.gitter.im/v1/rooms/:roomId/chatMessages
Get a message
 GET https://api.gitter.im/v1/rooms/:roomId/chatMessages/:messageId
Send a message
 POST https://api.gitter.im/v1/rooms/:roomId/chatMessages
Update a messagep g
 PUT https://api.gitter.im/v1/rooms/:roomId/chatMessages/:messageId
? # of characters
Can be created, updated, read via API
Can be “deleted” but not via API
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
12
CRUD
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TESTING CRUD OPERATIONS
Create, Read, Update, Delete
Test separately to validate each method works
Test the lifecycle of an object
 Catch issues with caching or concurrency
Create -> Read -> Update -> Read -> Delete -> Read
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
13
TESTING CRUD OPERATIONS
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
14
TESTING CRUD OPERATIONS
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
15
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TESTING CRUD OPERATIONS
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
16
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
BOUNDARIES
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
17
TESTING BOUNDARIES
Above and below numerical limits
Value must be <= 19.9 and Value must be > 0
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TESTING BOUNDARIES
How long can a message be?
 2402 worked
 6666 didn’t (400 Bad Request)
 4001 worked, 4151 didn’t
 4096 worked, 4097 didn’t
 4096 ASCII characters – UI blocks from > 4096
 4096 Unicode snowmen ☃
 4096 Japanese characters
We’ll visit this again with automation!
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
18
REQUIRED FIELDS
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TESTING REQUIRED FIELDS
If required data is omitted, it yields an accurate response
If I fail to submit required information
 Will I be able to understand how to fix it?
 Is it handled gracefully?
 Is the request processed as if it wasn’t required?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
19
TESTING REQUIRED FIELDS
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
20
TESTING REQUIRED FIELDS
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
21
FIELD TYPES
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TESTING FIELD TYPES
If the client sends a different data type than what is expected
 Expect INTEGER, send
 STRING
 DECIMAL
☃
Send a Message only has StringsSend a Message only has Strings
 Accepts Unicode and UTF-8
 BORING
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
22
TESTING FIELD TYPES
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
23
TESTING FIELD TYPES
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
24
FAILURE
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TESTING FOR FAILURE
Testing for uncontrollable circumstances
 500 Internal Server Error
 Timeouts
 404s
 Server Down
 Database not responding
How does the UI react when Web service has these issues?
Test for 3rd Party APIs having these issues
Use Service Virtualization
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
25
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
SECURITY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
26
TESTING SECURITY
Authentication vs. Authorization
Authentication
(who they are)
Does the
Authorization
(what they can do)
Does the
token allow
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
request have
a valid token?
token allow
access to this
resource?
TESTING SECURITY
Encryption
 Use Fiddler or Wireshark to see what the requests look like “over the wire”
SQL Injection
Fuzzing
 Sending tons of malformed data and see where it breaks
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
27
EXPLORATORY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
EXPLORATORY TESTING
Test design and test execution at the same time
– James Bach
Not scripted
Not pre-planned
Let the application lead you
Use your past experience as heuristicsUse your past experience as heuristics
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
28
EXPLORATORY TESTING WEB SERVICES
Apply the same principles as with a GUI interface
Think about other uses
 What else uses the API now?
 What else could use the API in the future?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
EXPLORATORY TESTING WEB SERVICES
q
 No documentation
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
29
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
30
AUTOMATED CHECKING
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
AUTOMATED CHECKING OF WEB SERVICES
Automate what can be checked repeatedly
Binary decisions (true or false) can be automated
 Does response code match what I’m expecting for this request?
 Is the response time within the SLA?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
31
AUTOMATION PROCESS
Decide on tooling
Common Utility Methods
 Performing the Web request
 Reading response content
 Performing a query of a database
Models
 Classes for the requests and responses
 Easier to manipulate an object for testing than a string
Write integration tests!
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
AUTOMATION PROCESS
Create utility method(s)
Create or reference models of requests and responses
App.config to hold auth keys, URIs, etc
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
32
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
33
AUTOMATION PROCESS
Start writing small, simple tests
 Hit the service with a valid request, get a 200 back?
 Hit the service, validate we get a specific field back correctly?
 Hit the service, validate we get a certain number of items?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
34
AUTOMATION PROCESS
Make it more interesting (and complicated)
 POST to the service, validate it posted
 Subsequent GET to the service
 Read from the database
 CRUD operations, in order
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
35
AUTOMATION PROCESS
Data-driven tests
 Same test structure, just different data and expected results
 Required fields (especially if there are a lot)
 Boundary tests
 0 characters – 200 OK
 10 characters – 200 OK
 4096 characters 200 OK 4096 characters – 200 OK
 4097 characters – 400 BAD REQUEST
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
36
AUTOMATE ALL THE THINGS!
Combine Integration and GUI Automation!
Example for Messages resource
 POST via Web Service
 Get the message ID and timestamp from the response body
 Launch the web app with Selenium
 Assert that message ID, with that timestamp and message text, appears properly
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
TEST THOSE WEB SERVICES!
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
9/6/2017
37
TEST THOSE WEB SERVICES
No pretty UI for end users
 Bugs in Web services cause just as many headaches for users
Different skill set for testers
 A lot of the same principles
Seems complicated
 Just a different window into our applications
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
THAT’S IT!
Code, Postman Collection, and Resources
https://github.com/g33klady/TestingRESTServices
Questions?Questions?
@G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY

More Related Content

Similar to Testing RESTful Web Services

[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale
[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale
[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale
Jessica Tai
 
[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale
[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale
[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale
Jessica Tai
 
Gojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applicationsGojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applications
Daniel Zivkovic
 
Data Driven API Testing: Best Practices for Real-World Testing Scenarios
Data Driven API Testing: Best Practices for Real-World Testing ScenariosData Driven API Testing: Best Practices for Real-World Testing Scenarios
Data Driven API Testing: Best Practices for Real-World Testing Scenarios
SmartBear
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
Guido Schmutz
 
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
Guido Schmutz
 
Azure and web sites hackaton deck
Azure and web sites hackaton deckAzure and web sites hackaton deck
Azure and web sites hackaton deck
Alexey Bokov
 
API SECURITY
API SECURITYAPI SECURITY
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
Konark modi
 
Eradicate Flaky Tests
Eradicate Flaky TestsEradicate Flaky Tests
Eradicate Flaky Tests
Anand Bagmar
 
CDS + Power Apps
CDS + Power Apps CDS + Power Apps
CDS + Power Apps
Juan Fabian
 
Support unlimited and ever changing customer experiences with GraphQL by Andr...
Support unlimited and ever changing customer experiences with GraphQL by Andr...Support unlimited and ever changing customer experiences with GraphQL by Andr...
Support unlimited and ever changing customer experiences with GraphQL by Andr...
Andrew Kumar
 
Managing microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupManaging microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - Meetup
José Román Martín Gil
 
Cloud computing for libraries an introduction
Cloud computing for libraries an introductionCloud computing for libraries an introduction
Cloud computing for libraries an introduction
Krista Godfrey
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testing
PetrosPlakogiannis
 
Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!
Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!
Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!
CA Technologies
 
Implement Web API with Swagger
Implement Web API with SwaggerImplement Web API with Swagger
Implement Web API with Swagger
Jiang Wu
 
Cloud Security Primer - F5 Networks
Cloud Security Primer - F5 NetworksCloud Security Primer - F5 Networks
Cloud Security Primer - F5 Networks
Harry Gunns
 
Service Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to KnowService Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to Know
TechWell
 

Similar to Testing RESTful Web Services (20)

[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale
[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale
[MicroCPH 2019] Airbnb's Great Migration: Building Services at Scale
 
[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale
[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale
[Codemotion Milan 2019] Airbnb's Great Migration - Building Services at Scale
 
Gojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applicationsGojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applications
 
Data Driven API Testing: Best Practices for Real-World Testing Scenarios
Data Driven API Testing: Best Practices for Real-World Testing ScenariosData Driven API Testing: Best Practices for Real-World Testing Scenarios
Data Driven API Testing: Best Practices for Real-World Testing Scenarios
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
 
Azure and web sites hackaton deck
Azure and web sites hackaton deckAzure and web sites hackaton deck
Azure and web sites hackaton deck
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
 
Eradicate Flaky Tests
Eradicate Flaky TestsEradicate Flaky Tests
Eradicate Flaky Tests
 
CDS + Power Apps
CDS + Power Apps CDS + Power Apps
CDS + Power Apps
 
Support unlimited and ever changing customer experiences with GraphQL by Andr...
Support unlimited and ever changing customer experiences with GraphQL by Andr...Support unlimited and ever changing customer experiences with GraphQL by Andr...
Support unlimited and ever changing customer experiences with GraphQL by Andr...
 
Managing microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupManaging microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - Meetup
 
Cloud computing for libraries an introduction
Cloud computing for libraries an introductionCloud computing for libraries an introduction
Cloud computing for libraries an introduction
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testing
 
Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!
Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!
Pre-Con Ed: There has to be a Better Way to Fast Test Coverage!
 
Implement Web API with Swagger
Implement Web API with SwaggerImplement Web API with Swagger
Implement Web API with Swagger
 
Cloud Security Primer - F5 Networks
Cloud Security Primer - F5 NetworksCloud Security Primer - F5 Networks
Cloud Security Primer - F5 Networks
 
Service Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to KnowService Virtualization: What Testers Need to Know
Service Virtualization: What Testers Need to Know
 

More from TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
TechWell
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
TechWell
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
TechWell
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
TechWell
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
TechWell
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
TechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
TechWell
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
TechWell
 
Ma 15
Ma 15Ma 15
Ma 15
TechWell
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
TechWell
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
TechWell
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
TechWell
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
TechWell
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
TechWell
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
TechWell
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
TechWell
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
TechWell
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
TechWell
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
TechWell
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
TechWell
 

More from TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Recently uploaded

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 

Recently uploaded (20)

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 

Testing RESTful Web Services

  • 1. W15 Testing Web Services 10/18/2017 3:00:00 PM Testing RESTful Web Services Presented by: Hilary Weaver-Robb Quicken Loans Brought to you by: 350 Corporate Way, Suite 400, Orange Park, FL 32073 888-­‐268-­‐8770 ·∙ 904-­‐278-­‐0524 - info@techwell.com - https://www.techwell.com/
  • 2. Hilary Weaver-Robb Quicken Loans Hilary Weaver-Robb is a software quality architect at Detroit-based Quicken Loans. She is a mentor to her fellow QA team members, makes friends with developers, and helps teams level-up their quality processes, tools, and techniques. Hilary has always been passionate about improving the relationships between developers and testers, and evangelizes software testing as a rewarding, viable career. She runs the Motor City Software Testers user group, working to build a community of quality advocates. Hilary tweets (a lot) as @g33klady, and you can find tweet-by-tweet recaps of conferences she's attended, as well as her thoughts and experiences in the testing world, at g33klady.com.
  • 3. 9/6/2017 1 TESTING RESTFUL WEB SERVICES Hilary Weaver-Robb @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY WHO DIS Hilary Weaver-Robb SQA Architect, Quicken Loans - Detroit @g33klady G33klady.com Github.com/g33kladyGithub.com/g33klady @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 4. 9/6/2017 2 OBJECTIVE What a Web service is What makes a Web service RESTful Why we should test Web services How to test RESTful Web services @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY WHAT IS A WEB SERVICE? A Web service is a method of communication between two electronic devices over a network. It is a software function provided at a network address over the Web with the service always on as in the concept of utility computing. The W3C defines a Web service generally as: a software system designed to support interoperable machine-to-machine interaction over a network. - Wikipedia @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 5. 9/6/2017 3 WHAT IS A WEB SERVICE? A website provides information consumable by humans A web service provides information consumable by software - A genius on StackOverflow All Web services are APIs, but not all APIs are Web services @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY WHAT MAKES A WEB SERVICE RESTFUL? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 6. 9/6/2017 4 WHAT IS REST? A way for systems to talk to one another (not always Web services) REST stands for REpresentational State Transfer Constraints:  Uniform Interface  Stateless  Cacheable  Client-Server  Layered System @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY WHAT MAKES A WEB SERVICE RESTFUL? Client-Server architecture using HTTP protocol  Client sends Request to Server  Server sends Response back @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 7. 9/6/2017 5 WHAT MAKES A WEB SERVICE RESTFUL? URL tells you what you’re working with and doing Messages can be lightweight (even just the URL!) CRUD operations using HTTP methods  Create/Update data (POST, PUT)  Read data (GET)  Delete data (DELETE) WAY easier to test than non-RESTful services @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY COMPARISON @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 8. 9/6/2017 6 HTTP RESPONSE CODES 200s – OK! 400s – What you’re asking for, we can’t do 500s – Should only be uncontrollable circumstances @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY WHY SHOULD WE TEST WEB SERVICES? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 9. 9/6/2017 7 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY WHY TEST WEB SERVICES? Usually complete before UI is even started Validate the ductwork UI can pull in multiple Web services Because it’s code! Integration Tests UI Tests @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY Unit Tests
  • 10. 9/6/2017 8 HOW CAN I TEST RESTFUL WEB SERVICES? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY HOW CAN I FIGURE OUT WHAT TO TEST? Documentation Swagger WADL/WSDL RAML (RESTful API Modeling Language) @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 11. 9/6/2017 9 HOW CAN I FIGURE OUT WHAT TO TEST? Check out the code  Controllers  Models  Tests Run web debugger and follow the calls @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY HOW CAN WE TEST WEB SERVICES? Manual Testing Tools  Postman  Fiddler  Advanced REST Client  ReadyAPI (SoapUI)  Swagger Automation Tools  Postman  ReadyAPI  Most unit testing frameworks Swagger @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 12. 9/6/2017 10 WHAT TYPES OF TESTS CAN WE PERFORM? Smoke tests CRUD tests Boundary Required Fields Field Type Error ConditionsError Conditions Security Performance @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY LET’S DO SOME TESTING! Gitter API  GitHub chat  https://gitter.im  Interact with rooms, users, and messages @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 13. 9/6/2017 11 MESSAGES RESOURCE SPECS List messages  GET https://api.gitter.im/v1/rooms/:roomId/chatMessages Get a message  GET https://api.gitter.im/v1/rooms/:roomId/chatMessages/:messageId Send a message  POST https://api.gitter.im/v1/rooms/:roomId/chatMessages Update a messagep g  PUT https://api.gitter.im/v1/rooms/:roomId/chatMessages/:messageId ? # of characters Can be created, updated, read via API Can be “deleted” but not via API @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 14. 9/6/2017 12 CRUD @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TESTING CRUD OPERATIONS Create, Read, Update, Delete Test separately to validate each method works Test the lifecycle of an object  Catch issues with caching or concurrency Create -> Read -> Update -> Read -> Delete -> Read @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 15. 9/6/2017 13 TESTING CRUD OPERATIONS @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 16. 9/6/2017 14 TESTING CRUD OPERATIONS @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 17. 9/6/2017 15 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TESTING CRUD OPERATIONS @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 18. 9/6/2017 16 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY BOUNDARIES @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 19. 9/6/2017 17 TESTING BOUNDARIES Above and below numerical limits Value must be <= 19.9 and Value must be > 0 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TESTING BOUNDARIES How long can a message be?  2402 worked  6666 didn’t (400 Bad Request)  4001 worked, 4151 didn’t  4096 worked, 4097 didn’t  4096 ASCII characters – UI blocks from > 4096  4096 Unicode snowmen ☃  4096 Japanese characters We’ll visit this again with automation! @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 20. 9/6/2017 18 REQUIRED FIELDS @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TESTING REQUIRED FIELDS If required data is omitted, it yields an accurate response If I fail to submit required information  Will I be able to understand how to fix it?  Is it handled gracefully?  Is the request processed as if it wasn’t required? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 21. 9/6/2017 19 TESTING REQUIRED FIELDS @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 22. 9/6/2017 20 TESTING REQUIRED FIELDS @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 23. 9/6/2017 21 FIELD TYPES @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TESTING FIELD TYPES If the client sends a different data type than what is expected  Expect INTEGER, send  STRING  DECIMAL ☃ Send a Message only has StringsSend a Message only has Strings  Accepts Unicode and UTF-8  BORING @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 24. 9/6/2017 22 TESTING FIELD TYPES @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 25. 9/6/2017 23 TESTING FIELD TYPES @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 26. 9/6/2017 24 FAILURE @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TESTING FOR FAILURE Testing for uncontrollable circumstances  500 Internal Server Error  Timeouts  404s  Server Down  Database not responding How does the UI react when Web service has these issues? Test for 3rd Party APIs having these issues Use Service Virtualization @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 27. 9/6/2017 25 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY SECURITY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 28. 9/6/2017 26 TESTING SECURITY Authentication vs. Authorization Authentication (who they are) Does the Authorization (what they can do) Does the token allow @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY request have a valid token? token allow access to this resource? TESTING SECURITY Encryption  Use Fiddler or Wireshark to see what the requests look like “over the wire” SQL Injection Fuzzing  Sending tons of malformed data and see where it breaks @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 29. 9/6/2017 27 EXPLORATORY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY EXPLORATORY TESTING Test design and test execution at the same time – James Bach Not scripted Not pre-planned Let the application lead you Use your past experience as heuristicsUse your past experience as heuristics @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 30. 9/6/2017 28 EXPLORATORY TESTING WEB SERVICES Apply the same principles as with a GUI interface Think about other uses  What else uses the API now?  What else could use the API in the future? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY EXPLORATORY TESTING WEB SERVICES q  No documentation @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 31. 9/6/2017 29 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 32. 9/6/2017 30 AUTOMATED CHECKING @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY AUTOMATED CHECKING OF WEB SERVICES Automate what can be checked repeatedly Binary decisions (true or false) can be automated  Does response code match what I’m expecting for this request?  Is the response time within the SLA? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 33. 9/6/2017 31 AUTOMATION PROCESS Decide on tooling Common Utility Methods  Performing the Web request  Reading response content  Performing a query of a database Models  Classes for the requests and responses  Easier to manipulate an object for testing than a string Write integration tests! @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY AUTOMATION PROCESS Create utility method(s) Create or reference models of requests and responses App.config to hold auth keys, URIs, etc @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 34. 9/6/2017 32 @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 35. 9/6/2017 33 AUTOMATION PROCESS Start writing small, simple tests  Hit the service with a valid request, get a 200 back?  Hit the service, validate we get a specific field back correctly?  Hit the service, validate we get a certain number of items? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 36. 9/6/2017 34 AUTOMATION PROCESS Make it more interesting (and complicated)  POST to the service, validate it posted  Subsequent GET to the service  Read from the database  CRUD operations, in order @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 37. 9/6/2017 35 AUTOMATION PROCESS Data-driven tests  Same test structure, just different data and expected results  Required fields (especially if there are a lot)  Boundary tests  0 characters – 200 OK  10 characters – 200 OK  4096 characters 200 OK 4096 characters – 200 OK  4097 characters – 400 BAD REQUEST @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 38. 9/6/2017 36 AUTOMATE ALL THE THINGS! Combine Integration and GUI Automation! Example for Messages resource  POST via Web Service  Get the message ID and timestamp from the response body  Launch the web app with Selenium  Assert that message ID, with that timestamp and message text, appears properly @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY TEST THOSE WEB SERVICES! @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY
  • 39. 9/6/2017 37 TEST THOSE WEB SERVICES No pretty UI for end users  Bugs in Web services cause just as many headaches for users Different skill set for testers  A lot of the same principles Seems complicated  Just a different window into our applications @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY THAT’S IT! Code, Postman Collection, and Resources https://github.com/g33klady/TestingRESTServices Questions?Questions? @G33KLADY | G33KLADY.COM | GITHUB.COM/G33KLADY