You are on page 1of 19

TESTING

WEB APPs & APIs


Online Test Conference 2016

Aaron Evans
aaron@one-shore.com
@fijiaaron
1-844-AUTOM87
Testing web apps & APIs
[cool ice breaker picture]

TESTING WEB APPs & APIs


Modern vs Traditional
[pictures of contrasting architectural designs]

TESTING WEB APPs & APIs


Modern vs Traditional
Responsive layout
Various screens sizes and formats (mobile, tablet, desktop)

Reactive display
Client side rendering. DOM manipulation

Web services
Communicates via AJAX to RESTful APIs

Cloud infrastructure
Deployed as independent containers

TESTING WEB APPs & APIs


Challenges
[picture denoting a challenge]

TESTING WEB APPs & APIs


Challenges
UI
Layout, application state, testing independent of services

API
No user interface, versioning, no shared state

Data Sources
Relational databases, noSQL, search, external web services

Cloud infrastructure setup deployment testing


Provisioning, configuration, intercommunication, security
TESTING WEB APPs & APIs
Solution
[picture: catching breath, calm, or mythical creatures]

TESTING WEB APPs & APIs


Solution
Separation of concerns

Test the UI without the back end

Test the back end without the UI

Test deployments without either the front end or back end

Environments that can be swapped out or rolled back seamlessly

TESTING WEB APPs & APIs


The front end
[tag cloud of front end frameworks]

Angular.js
React.js
Ember.js
Backbone.js
etc.

Mobile apps
Single page app
Different display sizes

TESTING WEB APPs & APIs


UI Testing
No longer bears the full burden of testing

Too slow, brittle, varied

Focus on:
End-to-end tests
Business acceptance criteria
Visual testing

TESTING WEB APPs & APIs


The Back End
[tag cloud of serverside web frameworks]

Node.js, Express, Koa, Ruby on Rails, Java, PHP, Go, .NET


etc.

REST
Microservices
Relational & NoSQL data stores (MongoDB, Redis, CouchDB, Elasticsearch,
etc.)
External services (payment processing, authorization, etc.)

TESTING WEB APPs & APIs


Testing REST APIs
Faster, less error prone

No user interface

Focus on:
Functionality of individual service
Integration of services
Smoke test entire system

TESTING WEB APPs & APIs


Deployment Testing
Containers & VMs

Continuous integration & delivery

Ability to switch from test to production with the flip of a switch (DNS)

TESTING WEB APPs & APIs


DEMO
Test the HART medical patient web app:

1. Register as a new user


2. Login
3. Make an appointment
4. Fill out insurance forms
5. Verify appointment is confirmed

TESTING WEB APPs & APIs


DEMO: UI Testing

Test as a user through the browser.

Manually, then automate.

Tools:
Javascript
Cucumber (BDD test framework)
Selenium (Webdriver.io)
Sauce Labs (Cloud devices)

TESTING WEB APPs & APIs


DEMO: API Testing
Test via the REST API

Manually using Postman, then automate

Tools:
Javascript
Cucumber (BDD test framework)
Postman (Google Chrome plugin)
Unirest (HTTP library)

TESTING WEB APPs & APIs


Confidence
Use continuous integration to:

Run tests after every build

Run tests after deployment to every environment

Benefits:
Quicker discovery of issues
More time for manual exploratory testing
Release changes on demand
Roll back production issues immediately

TESTING WEB APPs & APIs


Questions

TESTING WEB APPs & APIs


Thanks

TESTING WEB APPs & APIs

You might also like