27
Parasoft Proprietary and Confidential 1 Testing a Microservices Architecture

Testing a Microservices Architecture

Embed Size (px)

Citation preview

Page 1: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 1

2016-11-16

Testing a MicroservicesArchitecture

Page 2: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 2Parasoft Proprietary and Confidential 2

Open and hide your control panel

Join audio:• Choose “Mic & Speakers” to use VoIP• Choose “Telephone” and dial using the

information provided

Submit questions and comments via the Questionspanel

Note: Today’s presentation is being recorded andwill be provided within 48 hours.

Your Participation

GoToWebinar Housekeeping

Page 3: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 3Parasoft Proprietary and Confidential 3

Webinar - How to Approach API Testing for Microservices

https://alm.parasoft.com/how-to-approach-api-testing-for-microservices

Page 4: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 4Parasoft Proprietary and Confidential 4

White Paper for Testing Microservices

https://alm.parasoft.com/service-virtualization-microservices-migration

Page 5: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 5Parasoft Proprietary and Confidential 5

Microservices for our Purpose Today

Microservices refers to an architectural style that involves designing and implementing functionality as a

set of granular, independent services which are organized around business capability.

Page 6: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 6Parasoft Proprietary and Confidential 6

Driver #1 - Traditional Architecture

via Microservices by Martin Fowler (http://www.martinfowler.com/articles/microservices.html)

Release

Page 7: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 7Parasoft Proprietary and Confidential 7

Driver #1 - Microservices Architecture

via Microservices by Martin Fowler (http://www.martinfowler.com/articles/microservices.html)

Page 8: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 8Parasoft Proprietary and Confidential 8

Driver #2 – New Technology

Page 9: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 9Parasoft Proprietary and Confidential 9

Increased Number of System Dependencies

If current applications or services are decomposed into granular

services then we will see an exponential increased in system

dependencies

Page 10: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 10Parasoft Proprietary and Confidential 10

Access to connected applications is restricted

On average, enterprises cannot easily access 80% of connected applications (24 out of 30)

Distributed Applications are Hard to Access

1..34 5 7

15..17

Enterprise-based data and compute

resources

Cloud-based data and compute

resources

6

8

9

101112

13

14

18 19 20 2122

23

24

252627

28

29

30

Page 11: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 11Parasoft Proprietary and Confidential 11

Achieving Continuous Testing

Continuous Testing

Page 12: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 12Parasoft Proprietary and Confidential 12

Parallel Development Roadblock

Design Develop Test DeployTeam 1

Design Develop Test DeployTeam 2 Design Develop

Develop Test DeployTeam 3 Design Develop

Design Develop Test Deploy

With Agile or Parallel development, dependent system components are

created or evolve independently. Unfinished or evolving components

can delay release cycles.

Page 13: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 13Parasoft Proprietary and Confidential 13

Impact to the Traditional Methods

UI

API

Unit / Component

Sco

pe

of T

ests

Traditional UI testing must be supplemented with an earlier more

consistent approach to testing and quality. More logic in API layer.

Page 14: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 14Parasoft Proprietary and Confidential 14

Create an API test during development process (Parasoft

SOAtest)

https://www.parasoft.com/product/soatest/

Assessment of functionality

Use TDD approach (in combination with service virtualization)

Use contract or request/response pair to create both stub and

test artifact. As the microservice is developed, start invoking the

“real” application endpoint.

Use automation to quickly maintain/update regression tests

as microservices change.

Consume Swagger, RAML, WADL or WSDL to automate updating of

regression tests using Change Advisor (Parasoft SOAtest)

Shift Left Approach for Testing Microservices

Page 15: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 15Parasoft Proprietary and Confidential 15

Questions?

Microservices require Continuous Testing

To achieve Continuous Testing, we must mitigate the risk of increasingly

complex test environments.

Microservices changes the focus of testing.

As API regression test suites expand, we must reduce the overhead of

maintaining/updating these tests.

To learn more about Continuous Testing, read the Continuous Testing for IT

Leaders book available at https://alm.parasoft.com/continuoustestingbook or

Amazon.com. For a personalized demonstration, contact us at

[email protected]

Page 16: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 16

2016-11-16

Download Whitepaper

www.parasoft.com

Page 17: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 17Parasoft Proprietary and Confidential 17

Business Drivers for Microservices

Designed for rapid evolution

Focus on doing one thing well

Well suited for continuous delivery

Designed for scale

Great for cloud native apps

Independent scaling

Resilient to failure

Isolation

Loosely coupled

Page 18: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 18Parasoft Proprietary and Confidential 18

Microservices Challenges

Parallel development roadblocks

An increased number of system dependencies

More potential points of failure

Impacts to the traditional methods of testing

Shift from app-centric to transaction-centric

Many of the core benefits associated Microservices actually introduce

significant testing challenges

Page 19: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 19Parasoft Proprietary and Confidential 19

Take a “shift-left” Approach

Shift-left is not just about testing earlier. It’s a process commitment

between development, test or DevTest that defines quality expectations

Create an API test - Parasoft SOAtesthttps://www.parasoft.com/product/soatest/

Assessment of functionality

Assessment of environment stability

Monitor

Create a Service Virtualization (SV) Asset – Parasoft Virtualizehttps://www.parasoft.com/product/parasoft-service-virtualization/

For each Microservice you need an SV asset

Provide access to complete test environments

Simulation – of the environment

Page 20: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 20Parasoft Proprietary and Confidential 20

More Potential Points of Failure

The expansion of end-points or services will introduce more potential

points of failure. Monitoring is required.

Page 21: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 21Parasoft Proprietary and Confidential 21

Shift from App-Centric to Transaction-Centric

Traditional app-centric testing is now decentralized to process or

transaction-centric tests, creating a new demand for system access.

Page 22: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 22Parasoft Proprietary and Confidential 22

Testing Strategy for Microservices…

Benchmark the current state

Establish the foundation for

continuous testing

Take a “shift-left” approach

Identify the business critical paths and

dependencies

Page 23: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 23Parasoft Proprietary and Confidential 23

Benchmark the Current State

Benchmark the baseline performance and expectations predicated on

the existing functionality or documented (non)-functional requirements.

Risk assessment (required)

What are the expected microservice inputs and outputs?

What is the current (as-is) transaction speed?

If speed is a primary consideration for a microservice adoption, what is the anticipated future transaction speed?

What test data is currently leveraged to exercise the scope of functionality?

Will this still be appropriate for the migrated architecture?

Page 24: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 24Parasoft Proprietary and Confidential 24

The Foundation for Continuous Testing

If the goal is faster and easier to evolve, then we must be prepared with

an infrastructure for Continuous Testing

Map and prioritize tests versus environments

Simulate interactions with those dependencies if they are evolving, unstable,

or otherwise unavailable for development and testing

Rapidly access the approved sets of test data

Assess how each microservice change will impact the rest of the system

Identify test environment issues before they compromise the accuracy of

your test results

https://www.parasoft.com/solution/continuous-testing/

Page 25: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 25Parasoft Proprietary and Confidential 25

SV - an Environment Based Approach

Page 26: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 26Parasoft Proprietary and Confidential 26

Critical Paths and Dependencies

Tiers are relative to each process owner or development team member.

Each team must ID critical transaction paths

Page 27: Testing a Microservices Architecture

Parasoft Proprietary and Confidential 27Parasoft Proprietary and Confidential 27

Final Thoughts and Comment (Testing)

Containers

A dream for DevTest in terms of automation

Can assist in accessing dependencies

Geo / Political system constraints still exist

Test in Production

Do it…if you can

Good for UI elements or A/B testing scenarios

Test to Failure

Happy path becomes more dangerous

Weakest link

We must understand boundaries and consult with the business