evaluating and testing web apis

44
EVALUATING AND TESTING WEB APIS Ole Lensmar – SmartBear Software

Upload: smartbear

Post on 11-May-2015

2.142 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Evaluating and Testing Web APIs

EVALUATING AND TESTING WEB APIS

Ole Lensmar – SmartBear Software

Page 2: Evaluating and Testing Web APIs

the goal of this presentation…

Page 3: Evaluating and Testing Web APIs

Web APIs – what’s the fuss?

Page 4: Evaluating and Testing Web APIs

Aysnc /WebSockets

REST /JSON

SOAP / XML

Technically speaking…

but that’s missing the point…

Page 5: Evaluating and Testing Web APIs

20 Years Ago

ACME Corp(does monolithics)

Page 6: Evaluating and Testing Web APIs

10 Years Ago

ACME Corp(does SOA)

Web app

Corp

Page 7: Evaluating and Testing Web APIs

Corp

Corp

Now!

ACME Corp(does APIs)

Web app

Corp

App +

API

API

API

API

Device

APPAPI

Device

Device

Device

API

API

Page 8: Evaluating and Testing Web APIs

API Quality – Who needs it?

Page 9: Evaluating and Testing Web APIs

API Hierarchy of Needs

www.apiux.com

Page 10: Evaluating and Testing Web APIs

API Usability rules!

Page 11: Evaluating and Testing Web APIs

Who is your target persona?

Page 12: Evaluating and Testing Web APIs

User Experience

=

Developer Experience

Page 13: Evaluating and Testing Web APIs

Align with their API technology

SOAP / REST / etc…

XML / JSON / etc…

QoS / Security

Page 14: Evaluating and Testing Web APIs

Help them understand your API

vs

Page 15: Evaluating and Testing Web APIs

Provide API Metadata

Validation

Code Generation

Coverage

Understanding

Simulation

wsdl, swagger, wadl, hal, json

schema, apiary.io, xml schema, ws-

*, apiary, api-docs,

iodocs, etc

Page 16: Evaluating and Testing Web APIs

Align your API with their domain

Process / Workflow

Nomenclature

Related APIs

Page 17: Evaluating and Testing Web APIs

A 3:30:3 Litmus test for APIs

3 Minutes to understand what an API does

30 seconds to sign up

3 minutes to the first request

(Ori Pekelman)

Page 18: Evaluating and Testing Web APIs

APIs need to work

Page 19: Evaluating and Testing Web APIs

Expected Results

Page 20: Evaluating and Testing Web APIs

Expected Results

Values

Page 21: Evaluating and Testing Web APIs

Expected Results

Values

Datatypes

Page 22: Evaluating and Testing Web APIs

Expected Results

Values

Datatypes

Formatting

Page 23: Evaluating and Testing Web APIs

Expected Results

Values

Datatypes

Formatting

Consistency

Page 24: Evaluating and Testing Web APIs

Expected Results

Values

Datatypes

Formatting

Consistency

Errors

Page 25: Evaluating and Testing Web APIs

Bad Error Messages…

Change unexpectedly

Don’t match their status code (HTTP)

Don’t tell users what they did wrong

Don’t tell users what they need to do right

Show clients stuff that could be misused

Page 26: Evaluating and Testing Web APIs

APIs are global from day 1

Dates & Timezones

Regional Formatting

Localized Messages / Errors

Page 27: Evaluating and Testing Web APIs

ConsistencyConsistencyConsistencyConsistencyConsistencyConsistencyConsistencyConsistencyConsistencyConsistenc

Formatting

Nomenclature

Metadata Compliance

Page 28: Evaluating and Testing Web APIs

API Functional Test Automation

TestCase API 1 API 2

Page 29: Evaluating and Testing Web APIs

TestCase API 1 API 2

Request 1

Responsevalidate

API Functional Test Automation

Page 30: Evaluating and Testing Web APIs

TestCase API 1 API 2

Request 1

Response

Transfer parameters

Request 2

Response

validate

validate

API Functional Test Automation

Page 31: Evaluating and Testing Web APIs

TestCase API 1 API 2

Request 1

Response

Request 3

Response

Transfer parameters

Request 2

Response

Transfer parameters

validate

validate

validate

API Functional Test Automation

Page 32: Evaluating and Testing Web APIs

Pre vs Post-Deployment Quality

ContinuousIntegration

(Agile)

Automated Test

Execution

Page 33: Evaluating and Testing Web APIs

Pre vs Post-Deployment Quality

ContinuousIntegration

(Agile)

ContinuousDeploymen

t(DevOps)

Automated Test

Execution

months/weeks/days/

hours

Page 34: Evaluating and Testing Web APIs

Pre vs Post-Deployment Quality

ContinuousIntegration

(Agile)

ContinuousDeploymen

t(DevOps)

Automated Test

Execution

ProductionMonitoring

months/weeks/days/

hours

Test asset re-use

Page 35: Evaluating and Testing Web APIs

nowiggleroom

Page 36: Evaluating and Testing Web APIs

Customers rely on your API

Page 37: Evaluating and Testing Web APIs

Your API is key to their success

Is your API available?

Is your API consistent?

Is your API transparent?

Page 38: Evaluating and Testing Web APIs

Is your API Secure?

Do you handle identity?

Do you maintain integrity?

Do you assess vulnerabilities?

Page 39: Evaluating and Testing Web APIs

API Performance

Does the API perform consistently?

Does the API recover?

Does the API scale?

Page 40: Evaluating and Testing Web APIs

Usability Functionality

Core elements of API Quality

Reliability

Page 41: Evaluating and Testing Web APIs

so – let’s get back to that goal…

Page 42: Evaluating and Testing Web APIs
Page 43: Evaluating and Testing Web APIs
Page 44: Evaluating and Testing Web APIs

Thank you!

@[email protected]