more coverage, better diagnostics
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
More Coverage, Better Diagnostics
Including API Testing Into the Continuous Integration and Deployment Process
Ole Lensmar, SmartBear Software
Why should you care about API Testing?
Because today, APIs are at the core of everything!
MashupsMobile
Devices
Web
Apps
Game
Consoles
Cloud
ServicesSocial Media
Appliances B2B Partners
Other APIs
APIs
APIs are at the core of business strategies – not just technology strategies
APIs are showing extreme growth in all industries
(from programmableweb.com)
We are in the Golden Age of APIs!
What do we actually mean by “API”?
Buzzwords? Check!
…WOASOAPREST JSON WSDL XMLJMS Thrift HTTPSOA
OAuth Protocol Buffers
WADL WS-* POX
SPDY WebSockets
…
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
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
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?
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?
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
Single vs Multi-Request Tests
API 2
Multi-Request
Test
Request
Response
API 1
Request
Response
API 1
Request
Response
the “short” demo
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
Automated API Testing – what do we mean?
“Running preconfigured API Tests automatically using a test execution
framework or scheduler”
Functional – Performance - Security
In Agile you have
“Continuous Integration”
API Tests should be run automatically and continuously for every build of the software
In DevOps you have
“Continuous Deployment”
API Monitors run continuously toensure operations and production quality
Opportunity : Reuse of API Test Assets
Development :Continuous Integration / Deployment
Operations : API Monitoring
API Tests and Quality Assets
Benefits of Test Asset Reuse
Realistic monitoring
Feed-forward– how it’s supposed to
work
Feedback– Comprehensive error
information
Development
Operations
Automated Tests / Assets
Wrapping up -
How should you treat your APIs?
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
Thanks!