SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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 ScaleJessica 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 ScaleJessica 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 applicationsDaniel 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 ScenariosSmartBear
 
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 KafkaGuido Schmutz
 
apidays LIVE Australia - From micro to macro-coordination through domain-cent...
apidays LIVE Australia - From micro to macro-coordination through domain-cent...apidays LIVE Australia - From micro to macro-coordination through domain-cent...
apidays LIVE Australia - From micro to macro-coordination through domain-cent...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 KafkaGuido Schmutz
 
Azure and web sites hackaton deck
Azure and web sites hackaton deckAzure and web sites hackaton deck
Azure and web sites hackaton deckAlexey Bokov
 
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 TestsAnand 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 - MeetupJosé 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 introductionKrista 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 testingPetrosPlakogiannis
 
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 SwaggerJiang Wu
 
Cloud Security Primer - F5 Networks
Cloud Security Primer - F5 NetworksCloud Security Primer - F5 Networks
Cloud Security Primer - F5 NetworksHarry 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 KnowTechWell
 

Ähnlich wie 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 - From micro to macro-coordination through domain-cent...
apidays LIVE Australia - From micro to macro-coordination through domain-cent...apidays LIVE Australia - From micro to macro-coordination through domain-cent...
apidays LIVE Australia - From micro to macro-coordination through domain-cent...
 
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
 

Mehr von TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and RecoveringTechWell
 
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 ArchitectureTechWell
 
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 StartTechWell
 
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 StrategyTechWell
 
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 SuccessTechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowTechWell
 
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 SanityTechWell
 
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 StrategyTechWell
 
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 DevOpsTechWell
 
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—LeadershipTechWell
 
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 TeamsTechWell
 
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 GameTechWell
 
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 TeamsTechWell
 
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 ImplementationTechWell
 
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 ProcessTechWell
 
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 AutomateTechWell
 
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 SuccessTechWell
 
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 TransformationTechWell
 

Mehr von 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
 

Kürzlich hochgeladen

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Kürzlich hochgeladen (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (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