Testing the API behind a mobile app



Similar documents
Testing the API behind a mobile app. Tutorial Marc van t Veer

Configuration Guide. BES12 Cloud

QUICK INSTALLATION GUIDE ACTIVATE

Cloud Elements! Marketing Hub Provisioning and Usage Guide!

WEB SERVICES TEST AUTOMATION

Mobile Iron User Guide

THE NEW DIGITAL EXPERIENCE

Fairsail REST API: Guide for Developers

Online Data Services. Security Guidelines. Online Data Services by Esri UK. Security Best Practice

Media Server Installation & Administration Guide

Configuration Guide BES12. Version 12.3

Web Manual: October 2015

Mobile Banking Questions and Answers

THE NEW DIGITAL EXPERIENCE

Copyrighted , Address :- EH1-Infotech, SCF 69, Top Floor, Phase 3B-2, Sector 60, Mohali (Chandigarh),

Integrating Cisco ISE with GO!Enterprise MDM Quick Start

Workday Mobile Security FAQ

Reverse Proxy Guide. Version 2.0 April 2016

Service Virtualization

Prestashop Ship2MyId Module. Configuration Process

Instructions for Accessing the Hodges University Virtual Lab

Getting started with OWASP WebGoat 4.0 and SOAPUI.

Frequently Asked Questions Enterprise Mobile Manager

Mobile Admin Security

Configuration Guide BES12. Version 12.2

Safe Haven User Guide

File Transfer Examples. Running commands on other computers and transferring files between computers

User Guide. You will be presented with a login screen which will ask you for your username and password.

Ad Hoc (Temporary) Accounts Instructions

Getting Started with AWS. Hosting a Static Website

vcommander will use SSL and session-based authentication to secure REST web services.

How to configure the TopCloudXL WHMCS plugin (version 2+) Update: Version: 2.2

2-FACTOR AUTHENTICATION WITH

e-filing Secure Web Service User Manual

Configuration Guide - OneDesk to SalesForce Connector

WELCOME TO CITUS CLOUD LOAD TEST

FPT UNIVERSITY. Capstone Project

Accessing UniSIM MyMail For Students and Associates Via Microsoft Office 365. UniSIM - Restricted

603: Enhancing mobile device experience with NetScaler MobileStream Hands-on Lab Exercise Guide

5 Secrets to a Successful Mobile Application Testing Strategy

BlackBerry Enterprise Service 10. Universal Device Service Version: Administration Guide

DreamFactory on Microsoft SQL Azure

Configuration Manual English version

Establishing two-factor authentication with Barracuda NG Firewall and HOTPin authentication server from Celestix Networks

PARK UNIVERSITY. Information Technology Services. VDI In-A-Box Virtual Desktop. Version 1.1

tibbr Now, the Information Finds You.

2692 : Accelerate Delivery with DevOps with IBM Urbancode Deploy and IBM Pure Application System Lab Instructions

Web Manual: September 2014

SECURING MOBILE APPLICATIONS

The increasing popularity of mobile devices is rapidly changing how and where we

Can I transfer money to accounts I have at other Financial Institutions through Mobile Banking? No, we don t currently offer this service.

Native v HTML5 An Event Planner s Primer

SpringCM Troubleshooting Guide for Salesforce

Sophos Mobile Control Administrator guide. Product version: 3.6

Use Enterprise SSO as the Credential Server for Protected Sites

TIBCO ActiveMatrix Service Gateway User s Guide. Software Release 1.1 May 2012

Getting Started Guide for Developing tibbr Apps

Ce document a été téléchargé depuis le site de Precilog. - Services de test SOA, - Intégration de solutions de test.

ICE Trade Vault. Public User & Technology Guide June 6, 2014

Course Summary. Prerequisites

OAuth 2.0 Developers Guide. Ping Identity, Inc th Street, Suite 100, Denver, CO

Introduction to the Mobile Access Gateway

Dynamic DNS How-To Guide

WatchDox Administrator's Guide. Application Version 3.7.5

How To Get A Certificate From Digicert On A Pc Or Mac Or Mac (For Pc Or Ipa) On A Mac Or Ipad (For Mac) On Pc Or Pc Or Pb (For Ipa Or Mac) For Free

Business mail 1 MS OUTLOOK CONFIGURATION... 2

Integrating Autotask Service Desk Ticketing with the Cisco OnPlus Portal

Adobe Marketing Cloud Bloodhound for Mac 3.0

P-Synch by M-Tech Information Technology, Inc. ID-Synch by M-Tech Information Technology, Inc.

SOA Solutions & Middleware Testing: White Paper

SOA Software: Troubleshooting Guide for Policy Manager for DataPower

Workspot Configuration Guide for the Cisco Adaptive Security Appliance

PHP Language Binding Guide For The Connection Cloud Web Services

vcloud Air Platform Programmer's Guide

Parallels Virtual Automation 6.1

Cisco AnyConnect Secure Mobility Client VPN User Messages, Release 3.1

Reviewer Guide Core Functionality

Bootstrap guide for the File Station

How To Collaborate On A Project Plan 365 Plan On A Pcode On A Microsoft Project World On A Macbook Or Ipad Or Ipa Or Ipam Or Ipat Or Ipar Or Ipor Or Ipro Or Ipo Or Ip

MAGEJAM PLUGIN INSTALLATION GUIDE

Product Manual. MDM On Premise Installation Version 8.1. Last Updated: 06/07/15

Mobile Devices and API. Alex Solonenko, Director of SD Pascal Laumet, Director of Product Development

Manual. Netumo NETUMO HELP MANUAL Copyright Netumo 2014 All Rights Reserved

Computer Networking LAB 2 HTTP

Load Testing RIA using WebLOAD. Amir Shoval, VP Product Management

Law School Computing Services User Memo

Onset Computer Corporation

Office 365 deploym. ployment checklists. Chapter 27

Java Access to Oracle CRM On Demand. By: Joerg Wallmueller Melbourne, Australia

Quick Start Guide Mobile Entrée 4

Citrix Receiver for Enterprise Applications The technical detail

Exchange 2010 ActiveSync: Connection

ZODIANET API (ZAPI2)

Hubcase for Microsoft Dynamics CRM Installation and Configuration Guide

Transcription:

Testing the API behind a mobile app Marc van t Veer, Polteq www.eurostarconferences.com @esconfs #esconfs

Testing the API behind a mobile app System testing in a cloud enabling project Marc van t Veer

Content Introduction to an API What is an API Why an API? Using the API How-to test an API Example defects Lessons learned 4

What is an API? API, stands for application program interface, Set of routines, protocols, tools for building applications API reduces complexity Building blocks for a programmer My definition: Framework for communication between systems Own interface build upon existing internal SOA architecture 5

What is an API? app SoapUI Browser Test app s app Facebook API Adapter My T-Mobile (desktop web) My T-Mobile (Mobile web) Backend (Enterprise Service Bus) Adapter Webservices Adapter 6

Why an API? -examples Beltegoed Tulp / Zakelijk app from D-centralize 7

Why an API? -examples Bundels app from Skindustries 8

Why an API? -examples Beltegoed Tulp / Zakelijk app from D-centralize Bundels app from Skindustries Belstand app from Belstand Belstatus app from P-edge P-Edge quotes of customers Pointing with the blaming finger to T-Mobile * by Vinsert Before and after the update the app is not working. P-Edge said: "Please call customer service of T-Mobile". But they can't help and pointing back because this app is not theirs and it's a problem of P-Edge. 9

Why an API? -details Problem Too Diverse market with many platforms T-Mobile is not in control of its customer contacts Screen scrapers are not good and secure enough Solution Introduction of an API Requirements Introduction must be fast, much faster than direct competitors Ready for future projects 10

Using API - structure NS How does an API look like? Dutch Rail (NS) API example Structure of the API Division of Data and presentation Root(Start URL, http or https) Navigation View of a command-line Hierarchy Resources Account (private API) Structure schema 11

Using API - structure 12

Using API - structure 13

Using API My T-Mobile website 14

Using API My T-Mobile app 15

Using API My T-Mobile app User groups of API App s: Android, Iphone, Windows, Blackberry Internal T-Mobile Browser version of the API Social media: Facebook (internal/external) developers: Documentation Base line code for new App (with guidelines) Operations (monitoring) 16

How-to test an API? start from scratch Architecture REST vs. SOAP Stateless vs. Session Media types vs. WSDL text/xml application/vnd.capi.tmobile.nl.postpaidbundlestatus.v1 Verbs (GET) Resources Caching results Tools SoapUI, Fiddler, Browsers (like Firefox with add-ons) 17

Typical risks A. Unknown integration B.Big variation of customer data C.No control on the chain D.Load is unknown E. Wrong use of API F. Dynamic scope 18

Strategy Early integration test with complete infrastructure Integration test and dogfooding during Dev and ST Multiple integration phases Prototype app (on Acceptance environment) 19

Test approach 1. Development app SoapUI Browser (with dogfooding) Test app s 2. System testing (resources with backend and SIT) 3. Integration API testing (internal: My API T-Mobile with backend) (desktop web) 4. Acceptance testing (external: API with prototype app) 5. Production Adapter integration (in phases) 6. Regression testing (automated) My T-Mobile (Mobile web) Backend (Enterprise Service Bus) Adapter Webservices Adapter 20

Defect examples 4 examples Boundary between API - app 21

Cache key Test setup was: New session and clean all cookies/cache before each test case Each output for a resource is cached Defect was: it was cached with the same key for all customers Test scenario: login sequential with different users 22

Error status Validation of HTTP-Statuses (Error and related status) By using the general HTTP error code the app could not explicitly check what went wrong Error Code Error Code Api Status Description Reason Recommendation 401 -Unauthorized 1102 Invalid username or token. The application supplied invalid credentials. GUI: Ask for a different set of credentials. 401 -Unauthorized 1103 Account has been temporarily locked out. Too many invalid attempts have been tried for these credentials, so the account is locked out for at least 1 minute GUI: Ask the user to wait for at least 1 minute before retrying. 23

Max. units Test data with big variation in rateplans Total remaining bundle is determined by max. units. <Bundle> <Name>Flex 10</Name> <FreeUnits xsi:nil="true" /> <Unit>EURCENT</Unit> <MaxUnits>10</MaxUnits> <MaxUnitsPresentation> 10,00</MaxUnitsPresentation> <UsageAmount>148</UsageAmount> <UsageAmountPresentation> 1,48</UsageAmountPresentation> </Bundle> <Bundle> <Name>Bel&SMS 15</Name> <FreeUnits xsi:nil="true" /> <Unit>MIN/SMS</Unit> <MaxUnits>60/25</MaxUnits> <MaxUnitsPresentation>60 min./ 25 SMS</MaxUnitsPresentation> <UsageAmount>10/15</UsageAmount> <UsageAmountPresentation>10 min. / 15 SMS</UsageAmountPresentation> </Bundle> 24

Menu name error Loyalty Programs: T-Mobile Extra or T-Mobile Speciaal Generic service only menu name different Interface design: loyaltyprogramdescription value => TM Extra or TM Special Implementation T-Mobile frontend: If loyaltyprogramcode == "TME then ProgramDescription = "T-Mobile Extra" If loyaltyprogramcode == "TMS then ProgramDescription = "T-Mobile Speciaal 25

Lessons learned API API/app communication Testing 26

API A. New test type: production tests B. Command line C. Scope D. Security E. No backup tricks 27

API/app communication A. T-Mobile is (still) seen as responsible B. Presentation errors of data will always occur C.Very tempting to fix defects in app instead of API D. More explanation needed with secured API 28

Testing A. Normal test techniques B. Instrument for defect analysis C. Automated regression tests on production D. New responsibilities E. SOA/Interfaces/HTTP protocol/tools F. Experience with building interfaces 29

Summary Project API and app are live, API enables a new world API is now used by 500.000 users Prepared for the future: Facebook, Windows, Blackberry apps are coming System testing New responsibilities: support during all phases and production tests API tests are early integration tests in a broader scope Experienced team with SOA/interfaces and tools is a big plus 30

Questions or remarks? Test possiblity of API at the Polteq stand 31

References Source [Apple, 2009] [T-Mobile, 2011] Link iphone3g Commercial "There's An App For That" http://www.youtube.com/watch?v=szrsfeylzyg Customer API T-Mobile: https://capi.t-mobile.nl/ [Wiki,2012] API : http://en.wikipedia.org/wiki/application_programming_interfac e#use_of_apis_to_share_content REST architecture: http://en.wikipedia.org/wiki/representational_state_transfer Internet Media Types: http://en.wikipedia.org/wiki/internet_media_type#type_applica tion SOA: http://en.wikipedia.org/wiki/service-oriented_architecture Sequence diagrams: http://nl.wikipedia.org/wiki/unified_modeling_language Dogfooding: http://en.wikipedia.org/wiki/eating_your_own_dog_food 32

References, continued Source Link [SmartBear Software, 2011] SoapUI with REST: http://www.soapui.org/rest-testing/getting-started.html [Tweakers, 2012] [D-Centralize, 2012] [Belstatus, 2012] [Belstand, 2012] [Skindustries, 2012] More secure public API from NS: http://tweakers.net/nieuws/81389/ns-wil-apps-die-prijstreinreis-tonen-vooraf-keuren.html Beltegoed Tulp: http://www.d-centralize.nl/beltegoed Belstatus: http://www.p-edge.nl/belstatus Belstand: http://www.belstand.nl/ Bundels: http://www.skindustries.net/?p=portfolio&item=bundels 33

More information Marc van 't Veer Test consultant Polteq Dordrecht +31 (0) 646636148 (mob) http://www.polteq.com marc.vantveer@polteq.com 34

Backup slides 35

How-to test an API? Example test cases Phase Structure Element Test case Defect 0. Setup Test application Setup - Stub frame work -Tooling (SoapUI, browser,+ add-ins, Fiddler, AltovaXML Spy, FileZilla) - Interfaces and test data 1. Development Framework Dogfooding Check easy of use framework and how good it functions 2. System testing Functionality with and without stubs SIT With and without stubs Test applications No stubs Integration with Tibco URL Structure, parameters Header request :characterset, media types, Verbs (GET/POST/UPDATE), HTTP(S) Logging: Support defect analysis (server and database) HTTP-statussen: Error and related status Common validation/authentication/authorization Access codes (tokes) Profiles (subscription active, SIM active, token status) Customer/contract types Caching: Duration, authorization, clearing, content, multiple users Navigation: between resources Resources Profiles: Businessrules for each resource with variationcustomer data Output Presentation forms and versions (supported not supported) Monitoring Reporting and performance(load filter, backend availability Documentation Variation in customers, rateplans, prices, contract types, history, options with no stubs 3. Integration testing Internal API withcomplete backend No regression impact of other projects 4. Acceptance testing External integration API with prototype First integration of app with API Prototype app integration during acceptance testing: - Resource name of loyalty - Caching multiple users - HTTP statussen 5. Production testing Real customers API with live app Real customers with app on production API Production integration testing: -Variationin customers, rateplans,prices, contract types, history, options 6. Regression Regression Reruns - Manual and Automated regression tests 36