THE MAGIC BEHIND FASTER API
DEVELOPMENT, TESTING AND DELIVERY
WITH API VIRTUALIZATION
Presentedby: SmartBearCTO, Ole Lensmar
@olensmar| @SmartBear|#esconfs
Page
Proprietary & Confidential@SmartBear | #esconfs
What is API Virtualization?
Page
Proprietary & Confidential@SmartBear | #esconfs
Stubbing / Static Mocking
• Static responses
• Semanticallycorrect
• No logic
• Payloads generatedfrom schemas or examples
• Code or generated from metadata
• Usage: Client and Test development
Page
Proprietary & Confidential@SmartBear | #esconfs
Dynamic Mocking (Simulation)
• Dynamic responses
• Based on input
• Re-use input in output
• Scripting
• Data-driven/Data-generation
• Simulate state
• Assertions on incoming content
• Usage: Scenario Testing, Development
Page
Proprietary & Confidential@SmartBear | #esconfs
API Virtualization
• Runtime behavior simulation
• Runtime management
• Redirecttrafficto VirtualAPIs dynamically
• Accesscontrol
• Deployment
• Test execution integration
• Usage: Integration / Scenario Testing, Load Testing, Development
• Learn more: https://smartbear.com/learn/api-testing/what-is-api-virtualization/?md=social-post
Page
Proprietary & Confidential@SmartBear | #esconfs
A couple of use cases…
Page
Proprietary & Confidential@SmartBear | #esconfs
Bootstrap Development
Virtualized
API
Generate from
spec or with tools
Client Development
Test Design
Integration Development
• Shortcut the API development cycle / process
• Bridge dependencies between roles/teams
• Enable early feedback on API design / implementation
Page
Proprietary & Confidential@SmartBear | #esconfs
Component Isolation during Dev and Test
Component in
dev or test
Test Execution
(automated or manual)
3rd party APIs
(virtualized)
Other APIs
(virtualized)
Legacy Systems
(virtualized)
Development
• Simulate (un)expected behavior
• Minimize impact on and usage of external systems
• Assert usage of external components
Page
Proprietary & Confidential@SmartBear | #esconfs
Provide Sandbox for API consumers
Hardware / Software
Solution
API Virtual API
Evaluate
Integrate
Integration Test
• Provide simulations of different usage scenarios
• Minimize usage / exposure of real system
• Understand how customers interact with API
Page
Proprietary & Confidential@SmartBear | #esconfs
Performance Testing with API dependencies
Solution
under test
Load Test Execution
(automated or manual)
3rd party APIs
(virtualized)
Other APIs
(virtualized)
Legacy Systems
(virtualized)
• Simulate (un)expected performance in external systems
• Minimize impact on and usage of external systems
• Triage Performance bottlenecks
Page
Proprietary & Confidential@SmartBear | #esconfs
Corp
Corp
Web app
Corp
App +
API
API
API
API
Device
API
Device
IoT
Device
IoT
Device
API
API
API
Component Evolution in complex architectures
• Enable independent evolution of services by simulating
external dependencies as services move through lifecycle
Page
Proprietary & Confidential
Virtualization across the API Lifecycle
Design Build Test Deploy Manage
Static mocking
Dynamic mocking
API Virtualization
@SmartBear | #esconfs
Page
Proprietary & Confidential@SmartBear | #esconfs
How create virtualized APIs?
Page
Proprietary & Confidential@SmartBear | #esconfs
Create from API definition / contract
• Swagger,RAML, API Blueprint, WSDL, WADL, etc.
• Integratedschemasor examplesfor payloadgeneration
• StaticMocking often integratedin designtools
• Dedicatedtoolingcommon
Page
Proprietary & Confidential@SmartBear | #esconfs
Create from captured API usage
• Turn intercepted traffic into virtual APIs
• Log-file – limited payload data
• Captured traffic often needs to be “refined”
• Removal/ change of headers
• Removalof sensitive data
• Added logic for propagation of values
• SSL can be a challenge
• MITM with dedicatedcertificate
• Recordnon-functional aspects
Page
Proprietary & Confidential@SmartBear | #esconfs
Refine with dedicated tooling
• Add complex logic for request dispatching
• Add data-driven payloads
• Simulate non-functional behavior
• Add assertions for validating requests
• Pass-through to actual APIs as appropriate
Page
Proprietary & Confidential@SmartBear | #esconfs
Considerations
• How will virtual APIs be used and managed
• Local/Team/Enterprise
• Technical proficiency of maintainers
• Scripting /coding requirements
• Easy to createnew configurations
• CI-Integration
• How redirectAPI callstovirtualizedAPIs
• Access control (internal / external)
• Reporting and Governance
Page
Proprietary & Confidential@SmartBear | #esconfs
Virtualising Async APIs
• Domains
• Web: Webhooks, Async SOAP, Websockets
• Legacy:JMS, MQSeries, etc
• IoT protocols: MQTT, AMQP,XMPP, etc
• Virtualization Needs
• Simulate both sender and receiverof events
• Coordinate decoupled message flows /transactions
• Simulate both functional and non-functional behaviour
• Challenging to coordinate orchestrated components
Page
Proprietary & Confidential@SmartBear | #esconfs
API Virtualization – do you need it?
• Local development and basic component testing –> Probablynot
• For providing Sandbox environments -> Probably
• Collaborative evolution and testing of APIs with low number of controlled dependencies ->
Maybe
• The same – but with high number of complex dependencies -> Probably
• For simulating both functional and non-functional behavior in complex distributed API-based
solutions -> Definitely
Thank you!
@olensmar @SmartBear #esconfs

The Magic Behind Faster API Development, Testing and Delivery with API Virtualization

  • 1.
    THE MAGIC BEHINDFASTER API DEVELOPMENT, TESTING AND DELIVERY WITH API VIRTUALIZATION Presentedby: SmartBearCTO, Ole Lensmar @olensmar| @SmartBear|#esconfs
  • 2.
    Page Proprietary & Confidential@SmartBear| #esconfs What is API Virtualization?
  • 3.
    Page Proprietary & Confidential@SmartBear| #esconfs Stubbing / Static Mocking • Static responses • Semanticallycorrect • No logic • Payloads generatedfrom schemas or examples • Code or generated from metadata • Usage: Client and Test development
  • 4.
    Page Proprietary & Confidential@SmartBear| #esconfs Dynamic Mocking (Simulation) • Dynamic responses • Based on input • Re-use input in output • Scripting • Data-driven/Data-generation • Simulate state • Assertions on incoming content • Usage: Scenario Testing, Development
  • 5.
    Page Proprietary & Confidential@SmartBear| #esconfs API Virtualization • Runtime behavior simulation • Runtime management • Redirecttrafficto VirtualAPIs dynamically • Accesscontrol • Deployment • Test execution integration • Usage: Integration / Scenario Testing, Load Testing, Development • Learn more: https://smartbear.com/learn/api-testing/what-is-api-virtualization/?md=social-post
  • 6.
    Page Proprietary & Confidential@SmartBear| #esconfs A couple of use cases…
  • 7.
    Page Proprietary & Confidential@SmartBear| #esconfs Bootstrap Development Virtualized API Generate from spec or with tools Client Development Test Design Integration Development • Shortcut the API development cycle / process • Bridge dependencies between roles/teams • Enable early feedback on API design / implementation
  • 8.
    Page Proprietary & Confidential@SmartBear| #esconfs Component Isolation during Dev and Test Component in dev or test Test Execution (automated or manual) 3rd party APIs (virtualized) Other APIs (virtualized) Legacy Systems (virtualized) Development • Simulate (un)expected behavior • Minimize impact on and usage of external systems • Assert usage of external components
  • 9.
    Page Proprietary & Confidential@SmartBear| #esconfs Provide Sandbox for API consumers Hardware / Software Solution API Virtual API Evaluate Integrate Integration Test • Provide simulations of different usage scenarios • Minimize usage / exposure of real system • Understand how customers interact with API
  • 10.
    Page Proprietary & Confidential@SmartBear| #esconfs Performance Testing with API dependencies Solution under test Load Test Execution (automated or manual) 3rd party APIs (virtualized) Other APIs (virtualized) Legacy Systems (virtualized) • Simulate (un)expected performance in external systems • Minimize impact on and usage of external systems • Triage Performance bottlenecks
  • 11.
    Page Proprietary & Confidential@SmartBear| #esconfs Corp Corp Web app Corp App + API API API API Device API Device IoT Device IoT Device API API API Component Evolution in complex architectures • Enable independent evolution of services by simulating external dependencies as services move through lifecycle
  • 12.
    Page Proprietary & Confidential Virtualizationacross the API Lifecycle Design Build Test Deploy Manage Static mocking Dynamic mocking API Virtualization @SmartBear | #esconfs
  • 13.
    Page Proprietary & Confidential@SmartBear| #esconfs How create virtualized APIs?
  • 14.
    Page Proprietary & Confidential@SmartBear| #esconfs Create from API definition / contract • Swagger,RAML, API Blueprint, WSDL, WADL, etc. • Integratedschemasor examplesfor payloadgeneration • StaticMocking often integratedin designtools • Dedicatedtoolingcommon
  • 15.
    Page Proprietary & Confidential@SmartBear| #esconfs Create from captured API usage • Turn intercepted traffic into virtual APIs • Log-file – limited payload data • Captured traffic often needs to be “refined” • Removal/ change of headers • Removalof sensitive data • Added logic for propagation of values • SSL can be a challenge • MITM with dedicatedcertificate • Recordnon-functional aspects
  • 16.
    Page Proprietary & Confidential@SmartBear| #esconfs Refine with dedicated tooling • Add complex logic for request dispatching • Add data-driven payloads • Simulate non-functional behavior • Add assertions for validating requests • Pass-through to actual APIs as appropriate
  • 17.
    Page Proprietary & Confidential@SmartBear| #esconfs Considerations • How will virtual APIs be used and managed • Local/Team/Enterprise • Technical proficiency of maintainers • Scripting /coding requirements • Easy to createnew configurations • CI-Integration • How redirectAPI callstovirtualizedAPIs • Access control (internal / external) • Reporting and Governance
  • 18.
    Page Proprietary & Confidential@SmartBear| #esconfs Virtualising Async APIs • Domains • Web: Webhooks, Async SOAP, Websockets • Legacy:JMS, MQSeries, etc • IoT protocols: MQTT, AMQP,XMPP, etc • Virtualization Needs • Simulate both sender and receiverof events • Coordinate decoupled message flows /transactions • Simulate both functional and non-functional behaviour • Challenging to coordinate orchestrated components
  • 19.
    Page Proprietary & Confidential@SmartBear| #esconfs API Virtualization – do you need it? • Local development and basic component testing –> Probablynot • For providing Sandbox environments -> Probably • Collaborative evolution and testing of APIs with low number of controlled dependencies -> Maybe • The same – but with high number of complex dependencies -> Probably • For simulating both functional and non-functional behavior in complex distributed API-based solutions -> Definitely
  • 20.