THE MAGIC BEHIND FASTER API DEVELOPMENT, TESTING AND DELIVERY WITH API VIRTUALIZATION Presented by: SmartBear CTO, OAI Chairman, Ole Lensmar @olensmar | @SmartBear
Jan 23, 2018
THE MAGIC BEHIND FASTER API DEVELOPMENT, TESTING AND DELIVERY WITH API VIRTUALIZATION
Presentedby:SmartBearCTO,OAIChairman,OleLensmar
@olensmar |@SmartBear
Page
@SmartBear
Stubbing / Static Mocking
• Staticresponses• Semanticallycorrect• Nologic• Payloadsgeneratedfromschemasorexamples
• Codeorgeneratedfrommetadata
• Usage:ClientandTestdevelopment
Page
@SmartBear
Dynamic Mocking (Simulation)
• Dynamicresponses• Basedoninput• Re-useinputinoutput• Scripting
• Data-driven/Data-generation
• Simulatestate
• Usage:ScenarioTesting,Development
Page
@SmartBear
API Virtualization
• Runtimebehaviorsimulation
• Runtimemanagement• RedirecttraffictoVirtualAPIsdynamically• Accesscontrol• Deployment
• Testexecutionintegration• Assertionsonincomingcontent
• Usage:Integration/ScenarioTesting,LoadTesting,Development
Page
@SmartBear
Bootstrap Development
Virtualized APIGeneratefrom
specorwithtools
Client Development
Test Design
Integration Development
• ShortcuttheAPIdevelopmentcycle/process• Bridgedependenciesbetweenroles/teams• EnableearlyfeedbackonAPIdesign/implementation
Development
Page
@SmartBear
Component Isolation during Dev and Test
Component in dev or test
TestExecution(automatedormanual)
3rd party APIs(virtualized)
Other APIs(virtualized)
Legacy Systems(virtualized)
Development
• Simulate(un)expectedbehavior• Minimizeimpactonandusageofexternalsystems• Assertusageofexternalcomponents
Page
@SmartBear
Provide Sandbox for API consumers
Hardware / Software Solution
API Virtual API
Evaluate
Integrate
Integration Test
• Providesimulationsofdifferentusagescenarios• Minimizeusage/exposureofrealsystem• UnderstandhowcustomersinteractwithAPI
Page
@SmartBear
Performance Testing with API dependencies
Solution under test
LoadTestExecution(automatedormanual)
3rd party APIs(virtualized)
Other APIs(virtualized)
Legacy Systems(virtualized)
• Simulate(un)expectedperformanceinexternalsystems• Minimizeimpactonandusageofexternalsystems• TriagePerformancebottlenecks
Page
@SmartBear
Internal
Corp
Web app
Corp
App + API
API
API
API
Device
API
DeviceIoT
Device
IoTDevice
API
API
API
Component Evolution in complex architectures• Enableindependentevolutionofservicesbysimulating
externaldependenciesasservicesmovethroughlifecycle
Page
Virtualization across the API Lifecycle
Design Build Test Deploy Manage
Staticmocking
Dynamicmocking
APIVirtualization
@SmartBear
Page
@SmartBear
Create from API definition / contract
• Swagger/OAS,RAML,APIBlueprint,WSDL,WADL,etc.
• Integratedschemasorexamplesforpayloadgeneration
• StaticMockingoftenintegratedindesigntools
• Dedicatedtoolingcommon
Page
@SmartBear
Create from captured API usage
• ConvertinterceptedAPIresponsesintovirtualAPIs• Log-files– limitedpayloaddata
• Capturedtrafficoftenneedstobe“refined”• Removal/changeofheaders• Removalofsensitivedata• Addedlogicforpropagationofvalues
• Recordnon-functionalaspects• Responsetimes,latency,etc.
• RecordSSLusingMITMwithdedicatedcertificate
Page
@SmartBear
Refine with dedicated tooling
• Addcomplexlogicforrequestdispatching
• Adddata-drivenpayloads
• Simulatenon-functionalbehavior
• Addassertionsforvalidatingrequests
• Pass-throughtoactualAPIsasappropriate
Page
@SmartBear
Considerations
• HowwillvirtualAPIsbeusedandmanaged• Local/Team/Enterprise
• Technicalproficiencyofmaintainers• Scripting/codingrequirements
• CI-Integration• HowredirectAPIcallstovirtualizedAPIs
• Accesscontrol(internal/external)
• ReportingandGovernance
Page
@SmartBear
Virtualising Async APIs
• Domains• Web:Webhooks,Async SOAP,Websockets• Legacy:JMS,MQSeries,etc• IoT protocols:MQTT,AMQP,XMPP,etc
• VirtualizationNeeds• Simulatebothsenderandreceiverofevents• Coordinatedecoupledmessageflows/transactions• Simulatebothfunctionalandnon-functionalbehaviour
• Challengingtocoordinateorchestratedcomponents
Page
@SmartBear
API Virtualization – do you need it?
• Localdevelopmentandbasiccomponenttesting–>Probablynot
• ForprovidingSandboxenvironments->Probably
• CollaborativeevolutionandtestingofAPIswithlownumberofdependencies->Maybe
• Thesame– butwithhighnumberofcomplexdependencies->Probably
• Forsimulatingbothfunctionalandnon-functionalbehaviorincomplexdistributedAPI-basedsolutions/architectures->Definitely