more coverage, better diagnostics

26
More Coverage, Better Diagnostics Including API Testing Into the Continuous Integration and Deployment Process Ole Lensmar, SmartBear Software

Upload: smartbear

Post on 11-May-2015

592 views

Category:

Technology


0 download

DESCRIPTION

Ole Lensmar, co-creator of soapUI and Chief Architect at SmartBear Software, gave this presentation at STARWEST 2012. We are working, he says, in the "Golden Age of APIs."

TRANSCRIPT

Page 1: More Coverage, Better Diagnostics

More Coverage, Better Diagnostics

Including API Testing Into the Continuous Integration and Deployment Process

Ole Lensmar, SmartBear Software

Page 2: More Coverage, Better Diagnostics

Why should you care about API Testing?

Page 3: More Coverage, Better Diagnostics

Because today, APIs are at the core of everything!

Page 4: More Coverage, Better Diagnostics

MashupsMobile

Devices

Web

Apps

Game

Consoles

Cloud

ServicesSocial Media

Appliances B2B Partners

Other APIs

APIs

Page 5: More Coverage, Better Diagnostics

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

Page 6: More Coverage, Better Diagnostics

APIs are showing extreme growth in all industries

(from programmableweb.com)

Page 7: More Coverage, Better Diagnostics

We are in the Golden Age of APIs!

Page 8: More Coverage, Better Diagnostics

What do we actually mean by “API”?

Page 9: More Coverage, Better Diagnostics

Buzzwords? Check!

…WOASOAPREST JSON WSDL XMLJMS Thrift HTTPSOA

OAuth Protocol Buffers

WADL WS-* POX

SPDY WebSockets

Page 10: More Coverage, Better Diagnostics

An API is data or a service that is available over the network using a standard protocol and format

for example…

An HTTP search request returning results in JSON format

A SOAP request for authorizing access to a secured system

Page 11: More Coverage, Better Diagnostics

Common characteristics of APIs

APIs are consumed by software, not end users

APIs do not have a UI – there is nothing to “look” at or interact with

APIs expose business logic or functionality, mostly for integration purposes

APIs can be both private or public

Page 12: More Coverage, Better Diagnostics

Business A Business B

Service API 1

Service API 2

Service API 3

Public API

Public API

ServiceAPI

Web App Web AppMobile / Desktop App

JMS

REST

REST

REST

SOAP

ThriftSOAP

How do APIs fit into an architecture?

Page 13: More Coverage, Better Diagnostics

Quality Aspects of an API

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 14: More Coverage, Better Diagnostics

APIs generally implement a request-response model for exchanging messages or data

How do you test an API?

APITest

Parameterized Request

Response

A simple test sends a request message and validates that the response message has the expected content

Page 15: More Coverage, Better Diagnostics

Single vs Multi-Request Tests

API 2

Multi-Request

Test

Request

Response

API 1

Request

Response

API 1

Request

Response

Page 16: More Coverage, Better Diagnostics

the “short” demo

Page 17: More Coverage, Better Diagnostics

How does API Testing relate to other types of testing?

Web / Mobile / Desktop

API

UnitUnit Unit

Unit Unit Unit

UI Tests(automated or manual)

API Tests

Unit Tests

Page 18: More Coverage, Better Diagnostics

Automated API Testing – what do we mean?

Page 19: More Coverage, Better Diagnostics

“Running preconfigured API Tests automatically using a test execution

framework or scheduler”

Functional – Performance - Security

Page 20: More Coverage, Better Diagnostics

In Agile you have

“Continuous Integration”

API Tests should be run automatically and continuously for every build of the software

Page 21: More Coverage, Better Diagnostics

In DevOps you have

“Continuous Deployment”

API Monitors run continuously toensure operations and production quality

Page 22: More Coverage, Better Diagnostics

Opportunity : Reuse of API Test Assets

Development :Continuous Integration / Deployment

Operations : API Monitoring

API Tests and Quality Assets

Page 23: More Coverage, Better Diagnostics

Benefits of Test Asset Reuse

Realistic monitoring

Feed-forward– how it’s supposed to

work

Feedback– Comprehensive error

information

Development

Operations

Automated Tests / Assets

Page 24: More Coverage, Better Diagnostics

Wrapping up -

How should you treat your APIs?

Page 25: More Coverage, Better Diagnostics

R-E-S-P-E-C-T your APIs!

Design for usability

Test Early

Create Dedicated API Tests

Automate your tests

Assert performance and security

Page 26: More Coverage, Better Diagnostics

Thanks!

[email protected]