11
How to Cover all Your Backend Testing Needs With API & UI Tests Refael Botbol - Performance Engineer

How to Cover All Your Backend Testing Needs with API and UI Tests

Embed Size (px)

DESCRIPTION

How to cover all your backend testing needs with API and UI tests.

Citation preview

Page 1: How to Cover All Your Backend Testing Needs with API and UI Tests

How to Cover all Your Backend Testing Needs With API & UI Tests

Refael Botbol - Performance Engineer

Page 2: How to Cover All Your Backend Testing Needs with API and UI Tests

AGENDAWho Are We?

Quick Overview of API & UI Testing

API & UI Tests: Which Should You Use and When?

How Testing Integrates Into Your Application Lifecycle

Live Demo: Let’s Get Hands-On

Q&A§

02

Page 3: How to Cover All Your Backend Testing Needs with API and UI Tests

What is BlazeMeter?

The Performance Testing Platform forLoad, API, CI and Monitoring

Developer Friendly Open Source Compatibility Self Served

03

Page 4: How to Cover All Your Backend Testing Needs with API and UI Tests

What Can You Do With BlazeMeter?• Test any mobile app, website or API in under 10 minutes

• Simulate any number of users

• Run any open source Apache JMeter script

• Integrate automatically with your APM & CI tools

• Analyze results through comprehensive reporting

• Find and fix bottlenecks in your apps and website’s performance

04

Page 5: How to Cover All Your Backend Testing Needs with API and UI Tests

Quick Overview of API & UI Testing

The practice of using APIs in order to loosen the interdependencies between frontend (browser & mobile) and backend

API test your actual backend performance / functionality

Analyzing hits/s VS response times to identify bottlenecks

Testing UIs to verify user scenario(s) are working and responsive

Analyzing users VS response times

Using Selenium to improve understandingof actual user experience during the load test

Error monitoring: important in both cases but crucial for API calls!

05

Page 6: How to Cover All Your Backend Testing Needs with API and UI Tests

The application responds in the

same way throughout the test.

Response times are not affected by

the simulated load in any way.

The Perfect Load Test

0:00 0:10 0:20 0:30 0:400

10

20

30

40

50

60

70

Users Response Time

The Perfect Load Test

06

Page 7: How to Cover All Your Backend Testing Needs with API and UI Tests

The application initially responds well.

But once it reaches a certain load,

the response time starts to increase accordingly.

However, when you stop adding more load, the

response time will also stabilize.

Sensitive to Load

0:00 0:10 0:20 0:30 0:400

10

20

30

40

50

60

70

Users Response Time

Sensitive to Load

07

Page 8: How to Cover All Your Backend Testing Needs with API and UI Tests

We’re in a hell of a mess!

The application can’t sustain the load, and response times keep rising even though we’ve stopped increasing the load.

It’s clear that we’ve hit a significant bottleneck, something has probably broken and unless we solve it – the response time will only get worse!

Breaks Under Load

0:00 0:10 0:20 0:30 0:400

20

40

60

80

100

120

140

160

Users Response Time

Breaks Under Load

08

Page 9: How to Cover All Your Backend Testing Needs with API and UI Tests

API & UI Tests: Which Should You Use and When?

1. Unit testing2. As part of your CI builds3. Staging performance4. Before adding a new service

which will require more hits/s5. Changes in the application

design (New DB, Upgrades..)

API – Testing your backend functionality and performance to understand how many hits/s it can sustain

1. Before major events (Black Friday, commercial events, elections etc..)

2. Before releasing a new frontend version

UI – Verifying the quality of your user scenario and response times

Both can be used as monitoring scripts

09

Page 10: How to Cover All Your Backend Testing Needs with API and UI Tests

Write your unit testing scripts to verify the code works (simple JMX)

HOW TESTING INTEGRATES INTO YOUR APPLICATION LIFECYCLE

Integrate unit testing into your CI tools (Jenkins, CloudBees etc.) and run them after important builds

Create a user scenario script and add it to your CI builds to verify critical user scenarios are not broken

Use these scripts with higher load on your staging environment to verify your API and user scenarios are working as planned

Add a JMeter Selenium Web Driver to measure user experience during the load

Take the same scripts and load test inproduction when needed

10

Page 11: How to Cover All Your Backend Testing Needs with API and UI Tests

For more information about Performance Testing and JMeter:

BlazeMeter.com/blog/ [email protected] @BlazeMeter

Want to find out more?

Read our blog post on API & UI Testing:

http://bit.ly/UI-API

Watch the webcast: http://bit.ly/apiuiwebcast

11