Top Banner
50

Testing APIs in the Cloud

May 11, 2015

Download

Technology

SmartBear

Erik Yverling, an API expert and soapUI developer at SmartBear-Sweden, gave this presentation at WebTech Conference 2012.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Testing APIs in the Cloud
Page 2: Testing APIs in the Cloud

Erik R. Yverling | SmartBear

Testing APIs in the Cloud

Page 3: Testing APIs in the Cloud

Erik R. Überling | SmartBear

Testing APIs in the Cloud

Page 4: Testing APIs in the Cloud

A little bit about me

• Developer at SmartBear working on soapUI

• Lives in Stockholm, Sweden

• Agile enthusiast

• Linux and Open Source lover

• Just another fellow geek

Page 5: Testing APIs in the Cloud

No code :(

Page 6: Testing APIs in the Cloud

Recommendations!

Page 7: Testing APIs in the Cloud

Overview

• Golden age of APIs

• Testing APIs

• Testing APIs in the Cloud

• Testing APIs from the Cloud

• Recommendations

Page 8: Testing APIs in the Cloud

Golden age of APIs

Page 9: Testing APIs in the Cloud

Golden age of APIs

• APIs are at the core of business strategies – not just

technology strategies

Page 10: Testing APIs in the Cloud

Source: programmableweb.com

Year

Reg

istr

ed

AP

Is

APIs are growing rapidly

Page 11: Testing APIs in the Cloud

Testing APIs

API

Page 12: Testing APIs in the Cloud

Quality aspects of APIs

• Functionality – does it work as expected?

• Performance – does it perform as required?

• Security – is it secured for common attacks?

• Usability – is it usable?

• Compliance – does it follow common practices?

Page 13: Testing APIs in the Cloud

How are APIs tested?

APIs generally implement a request-response

model for exchanging messages or data

API Test

Parameterized Request

Response

A simple test sends a request message and validates

that the response message has the expected content

Page 14: Testing APIs in the Cloud

Testing APIs in the Cloud

API

Page 15: Testing APIs in the Cloud

APIs + the Cloud = true

• High availability

• High scalability

• Easy deployment on the locations of your customer

Page 16: Testing APIs in the Cloud

Quality aspects of cloud APIs

• Functionality – does it work as expected?

• Performance – does it perform as required?

• Security – is it secured for common attacks?

• Usability – is it usable?

• Compliance – does it follow common practices?

• Policy and regulations– does it follow your legal regulations?

Page 17: Testing APIs in the Cloud

Functionality

• Does it matter where your API is deployed?

– Timestamps?

– Time zones?

– Locales?

Page 18: Testing APIs in the Cloud

Performance

• How to handle shared resources with others?

• How to make sure that the API is able to scale?

Page 19: Testing APIs in the Cloud

Security

• How to handle sensitive transactions to your

backend?

Page 20: Testing APIs in the Cloud

Policy and regulations

• How much of your traffic that is allowed to cross

country boarders?

• US export controls

• Is there a limit for load testing?

• What about costs related to transactions?

Page 21: Testing APIs in the Cloud

Policy and regulations

• What happens if your API stops working?

Page 22: Testing APIs in the Cloud

Testing APIs from the Cloud

API

Page 23: Testing APIs in the Cloud

Test Environment

as a service (TEaaS)

API

Page 24: Testing APIs in the Cloud

Quality aspects of APIs tested from the Cloud

• Functionality – does it work as expected?

• Performance – does it perform as required?

• Security – is it secured for common attacks?

• Usability – is it usable?

• Compliance – does it follow common practices?

• Policy and regulations– does it follow your legal regulations?

Page 25: Testing APIs in the Cloud

Functionality

• How will your application react to request from

different locations?

Page 26: Testing APIs in the Cloud

Performance

• How will your API react on distributed load?

Page 27: Testing APIs in the Cloud

Security

• Will you be able to test your API from all kinds of

locations?

• Is there some locations that should not be able to

reach the API?

Page 28: Testing APIs in the Cloud

Whoa!

Using the Cloud seams like a lot of work!

Page 29: Testing APIs in the Cloud

Recommendations!

Page 30: Testing APIs in the Cloud

Testing APIs in the Cloud

API

Page 31: Testing APIs in the Cloud

Functionality

• Reuse test cases during development for monitoring

Page 32: Testing APIs in the Cloud

In Agile you have

“Continuous Integration”

API Test should be run automatically and

continuously for every build of the software

Page 33: Testing APIs in the Cloud

In DevOps you have

“Continuous Deployment”

API Monitors run continuously to

ensure operations and production quality

Page 34: Testing APIs in the Cloud

Agile

Business Development Operations

DevOps

Page 35: Testing APIs in the Cloud

Benefits of Test Asset Reuse

Development :

Continuous Integration / Deployment

Operations : API Monitoring

API Tests and

Quality Assets

Page 36: Testing APIs in the Cloud

Functionality

• Reuse test cases during development for monitoring

• Start with a local baseline setup to compare with

• Mock out external dependencies to begin with

• Mind the backwards compatibility

Page 37: Testing APIs in the Cloud

Functionality

• Run regression tests against different locations

• Designing your application for failure recovery

Page 38: Testing APIs in the Cloud

Performance

• Make performance requirements

• Experiment with the load

• Parallelize

• Consider using dedicated machines

• Use monitoring together with the load test

Page 39: Testing APIs in the Cloud

Performance

• Run load tests in an isolated environment for root

cause analysis

• Chaos monkey!

Page 40: Testing APIs in the Cloud

Security

• Make security requirements

• Encrypt sensitive transactions to your backend

• Encrypt data before sending it to the Cloud

• Find out who is responsible for the different aspects

of security

Page 41: Testing APIs in the Cloud

Policy and regulations

• Check the legal implications with your company

experts

• Check what backup/recovery solution your provider

offers

• Check the providers regulations for load testing

• Do a calculation on what it may cost you to run your

load tests

Page 42: Testing APIs in the Cloud

Compliance

• Don’t always follow standards to the letter (others

may not).

• Look for best practices and reference

implementations

Page 43: Testing APIs in the Cloud

Testing APIs from the Cloud

API

Page 44: Testing APIs in the Cloud

Functionality

• Beware of from where you tests are run

• Run functional tests that depends on a geographical

location from that actual geographical location

• Easily create nodes in your test lab for different client

setups

Page 45: Testing APIs in the Cloud

Performance

• Use distributed load testing for better performance

• Scale your test suite along with your API

Page 46: Testing APIs in the Cloud

Security

• Make sure to cover locations that should not be able

to access the API

• Be aware of firewalls if your API is protected

Page 47: Testing APIs in the Cloud

Summary

• Golden age of APIs

• Testing APIs

• Testing APIs in the Cloud

• Testing APIs from the Cloud

• Recommendations

Page 48: Testing APIs in the Cloud

Try this at home!

• Check out soapUI Test On Demand

• http://www.soapui.org

Page 49: Testing APIs in the Cloud

?

Page 50: Testing APIs in the Cloud

Contact

• @erikryverling

• @soapui

[email protected]