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."
10. 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
11. 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
12. How do APIs fit into an architecture?
Business A Business B
Mobile / Web App
Web App Desktop App
REST
SOAP
Public REST Public
API API
REST
JMS
SOAP Thrift
Service Service Service Service
API 1 API 2 API 3 API
13. 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?
14. How do you test an API?
APIs generally implement a request-response
model for exchanging messages or data
Parameterized Request
Test API
Response
A simple test sends a request message and validates
that the response message has the expected content
15. Single vs Multi-Request Tests
Request
API 1
Response
Multi- Request
Request API 2
Test
Response
Request
API 1
Response
17. How does API Testing relate to
other types of testing?
UI Tests
Web / Mobile / Desktop
(automated or manual)
API Tests API
Unit Unit Unit
Unit Tests
Unit Unit Unit
19. “Running preconfigured API Tests
automatically using a test execution
framework or scheduler”
Functional – Performance - Security
20. In Agile you have
“Continuous Integration”
API Tests should be run automatically and
continuously for every build of the software
21. In DevOps you have
“Continuous Deployment”
API Monitors run continuously to
ensure operations and production quality
22. Opportunity : Reuse of API Test Assets
Development :
Continuous Integration / Deployment
API Tests and
Quality Assets
Operations : API Monitoring
23. Benefits of Test Asset Reuse
Realistic monitoring
Development
Feed-forward
– how it’s supposed to
work Automated
Tests / Assets
Feedback
– Comprehensive error
information Operations