testistanbul 2013 conference “future of testing: new techniques and methodologies” don’t test...
TRANSCRIPT
TestIstanbul 2013 Conference“Future Of Testing: New Techniques and Methodologies”
Don’t Test Your Application (Just) by its Cover – Test its APIs as Well!
Malcolm Isaacs (@MalcolmIsaacs)[email protected]
TestIstanbul Conferences 2013
Agenda
Introduction to APIs
What Should we Test?
Challenges of API Testing
Getting Started With API Testing
Practicalities of Writing a Test
TestIstanbul Conferences 2013
What is this Session About?
JUDGE
ME
by
Mik
e Hov
erDON’T
Malcolm
Isaa
cs
TestIstanbul Conferences 2013
Introduction to APIs
REST (XML)
SOAP
IDOC
JDBC
JMS
HTTP/HTML
HTTP/HTML 5
3rd Party Service Provider
Business Partner
.NET
Composite App Infrastructure
REST (JSON)
Consumers
HTTP/XML
TestIstanbul Conferences 2013
Just Some of the APIs…
TestIstanbul Conferences 2013
Just Some of the APIs…
<note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body> Don't forget me this weekend! </body></note>
TestIstanbul Conferences 2013
Just Some of the APIs…
<!DOCTYPE html><html> <body> <a href="http://www.testistanbul.org/"> This is a link </a> </body></html>
TestIstanbul Conferences 2013
Just Some of the APIs…
<?xml version="1.0"?><soap:Envelope> <soap:Header> </soap:Header> <soap:Body> <m:GetStockPrice> <m:StockName>HP</m:StockName> </m:GetStockPrice> </soap:Body></soap:Envelope>
TestIstanbul Conferences 2013
Just Some of the APIs…
http://www.acme.com/phonebook/UserDetails/12345
TestIstanbul Conferences 2013
Just Some of the APIs…
{ "glossary": { “title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "GlossTerm": “SGML", "GlossDef": { "para": "A meta-markup language.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup“ } } } } }
TestIstanbul Conferences 2013
Just Some of the APIs…
public class HelloWorld { // method main(): The app’s entry point public static void main (String[] args) { System.out.println ("Hello World!"); }}
TestIstanbul Conferences 2013
Just Some of the APIs…
TestIstanbul Conferences 2013
What Should We Test?
Unit Tests
TestIstanbul Conferences 2013
What Should We Test?
REST (XML)
SOAP
IDOC
JDBCJMS
3rd Party Service Provider
Business Partner
.NET
Composite App Infrastructure
REST (JSON)
Integration/System Tests
TestIstanbul Conferences 2013
What Should We Test?
REST (XML)
SOAP
IDOC
JDBCJMS
HTTP/HTML
HTTP/HTML 5
3rd Party Service Provider
Business Partner
.NET
Composite App Infrastructure
REST (JSON)
ConsumersFunctional Tests
TestIstanbul Conferences 2013
What Should We Test?
REST (XML)
SOAP
IDOC
JDBCJMS
HTTP/HTML
HTTP/HTML 5
3rd Party Service Provider
Business Partner
.NET
Composite App Infrastructure
REST (JSON)
Consumers
HTTP/XML
Load/Stress Tests
TestIstanbul Conferences 2013
What Should We Test?
REST (XML)
SOAP
IDOC
JDBCJMS
HTTP/HTML
HTTP/HTML 5
3rd Party Service Provider
Business Partner
.NET
Composite App Infrastructure
REST (JSON)
Consumers
HTTP/XMLSecurity Tests
TestIstanbul Conferences 2013
Challenges of API Testing
Source:http://fitdeck.com/Portals/24254/images/Sunrise.jpg
TestIstanbul Conferences 2013
Challenges of API Testing – Early Testing
Source:http://fitdeck.com/Portals/24254/images/Sunrise.jpg
TestIstanbul Conferences 2013
Challenges of API Testing - Collaboration
Source: http://www.hp.com/hpinfo/newsroom/feature_stories/2009/images/09collaboration.jpg
TestIstanbul Conferences 2013
Challenges of API Testing - Standards
Source: http://www.infoq.com/news/2007/03/innoq-ws-standards-poster
TestIstanbul Conferences 2013
Challenges of API Testing – Managing Change/Versions
TestIstanbul Conferences 2013
Challenges of API Testing – Availability
Source: http://www.lego.com/en-US/shared/PageNotFound.aspx
TestIstanbul Conferences 2013
Challenges of API Testing - Security
Source: http://icdn9.digitaltrends.com/image/security-650x0.jpg
TestIstanbul Conferences 2013
Challenges of API Testing - Data
Sources: http://upload.wikimedia.org/wikipedia/en/e/e3/Microsoft_Excel_2013_Default_Screen.png,http://en.wikipedia.org/wiki/SOAP_(protocol), http://en.wikipedia.org/wiki/Json
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> </soap:Header> <soap:Body> <m:GetStockPrice xmlns:m="http://www.example.org/stock"> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>{ "firstName": "John", "lastName": "Smith", "age": 25,
"address": { "streetAddess": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": 10021 }, "phoneNumbers": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] }
TestIstanbul Conferences 2013
Challenges of API Testing at a Glance
Testing Challenges
Functional Testing
Data Managem
ent
Composite QM
Project
Change ImpactLoad
Testing Implications
End-to-end/ Business Process Testing
Security
Architecture
Governance
Simulating Missing Services
TestIstanbul Conferences 2013
Getting Started with API Testing
Engage Engineer
Find a Tool
Automate Tests
Run Tests
TestIstanbul Conferences 2013
Practicalities of Writing a Test
Import API
Define Flow
Configure Propertie
s
Define Checkp
oints
Run Test
Roll Out
TestIstanbul Conferences 2013
Summary
Thank You!
Malcolm Isaacs (@MalcolmIsaacs)[email protected]