how!fast!is!my!app?performance testing101!€¦ · page loading performance •users are selfish...

20
W2 Performance Testing Wednesday, October 23rd, 2019 10:15 AM How Fast Is My App? Performance Testing 101 Presented by: Gene Gotimer Coveros, Inc. Brought to you by: 8882688770 9042780524 [email protected] http://www.starcanada.techwell.com/

Upload: others

Post on 18-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

   W2  Performance  Testing  Wednesday,  October  23rd,  2019  10:15  AM          

How  Fast  Is  My  App?  Performance  Testing  101  

 Presented  by:    

 

  Gene  Gotimer    

Coveros,  Inc.    

Brought  to  you  by:        

   

   

888-­‐-­‐-­‐268-­‐-­‐-­‐8770  ·∙·∙  904-­‐-­‐-­‐278-­‐-­‐-­‐0524  -­‐  [email protected]  -­‐  http://www.starcanada.techwell.com/        

 

Page 2: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

     

Gene  Gotimer    Gene  Gotimer  is  a  proven  senior  software  architect  with  many  years  of  experience  in  web-­‐based  enterprise  application  design,  most  recently  using  Java.  He  is  skilled  in  agile  software  development  as  well  as  legacy  development  methodologies  and  designing  and  developing  secure,  high-­‐quality  software.  He  has  extensive  experience  establishing  and  using  development  ecosystems  including  continuous  integration,  continuous  delivery,  DevOps,  unit  testing,  and  a  variety  of  software  assurance  tools  and  supporting  processes.  Gene  feels  strongly  that  repeatability,  quality,  and  security  are  all  strongly  intertwined;  each  of  them  is  dependent  on  the  other  two,  which  just  makes  agile  and  DevOps  that  much  more  crucial  to  software  development.    

Page 3: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

1

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 1@CoverosGene #STARCANADA

Agility. Security. Delivered.

How Fast is My App?Performance Testing 101

Gene [email protected]

@CoverosGene

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 2@CoverosGene #STARCANADA

About Coveros• Coveros helps companies accelerate the delivery of

secure, reliable software using agile methods

• Agile & DevOps Services• DevOps Implementation• DevSecOps Integration• Agile Transformations & Coaching• Agile Software Development• Agile Testing & Automation

• Agile, DevOps, Testing, Security Training

• Open Source Products• SecureCI – Secure DevOps toolchain• Selenified – Agile test framework

Development Platforms

1

2

Page 4: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

2

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 3@CoverosGene #STARCANADA

Selected Commercial Clients

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 4@CoverosGene #STARCANADA

Selected Federal Clients

3

4

Page 5: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

3

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 5@CoverosGene #STARCANADA

What is Performance Testing?

I Love Lucy“Job Switching”

© 1952 CBS

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 6@CoverosGene #STARCANADA

Principles of Performance Testing

5

6

Page 6: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

4

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 7@CoverosGene #STARCANADA

Page Loading Performance• Users are selfish when it comes to page loading times.

They don't care what is slowing it down or why, they just want the page to load quickly.

• If they think it is too slow for them, it is too slow for them.

• Browsers often have performance measurement and analysis capabilities in the web development tools.

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 8@CoverosGene #STARCANADA

Chrome Developer Tools

7

8

Page 7: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

5

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 9@CoverosGene #STARCANADA

Firefox Web Developer Tools

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 10@CoverosGene #STARCANADA

Google PageSpeed Insights

https://developers.google.com/speed/pagespeed/insights/

9

10

Page 8: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

6

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 11@CoverosGene #STARCANADA

Key Takeaway• If the user says the page is loading too slowly for them, it is loading

too slowly for them. No matter how fast it loads.

• Use browser and web site tools to measurepage load speeds.

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 12@CoverosGene #STARCANADA

Principles of Performance Testing

What are we measuring?

•How long does it take?

•How big a system do we need?

•How much can we handle at once?

Time behavior

Resource utilization

Capacity

11

12

Page 9: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

7

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 13@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 14@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

13

14

Page 10: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

8

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 15@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 16@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

15

16

Page 11: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

9

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 17@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 18@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

17

18

Page 12: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

10

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 19@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 20@CoverosGene #STARCANADA

Key Takeaway• Performance testing is a field, not a particular kind of test.

Understand what you are trying to test for.

19

20

Page 13: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

11

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 21@CoverosGene #STARCANADA

Sorting App• Spring Boot Java app

• Static web page, links to REST calls

• Sorting algorithms to sort 20,000 shuffled words

• Different speeds to showcaseperformance results

• Gatling and JMeter tests

https://github.com/Coveros/sorting

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 22@CoverosGene #STARCANADA

Gatling• Load test tool

• Open source version

• Simulation scripts are written in Scala• but you don't need to know much

• Includes a web recorder

https://gatling.io

21

22

Page 14: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

12

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 23@CoverosGene #STARCANADA

Gatling

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 24@CoverosGene #STARCANADA

Apache JMeter• Load test tool

• Free, open source

• Very popular

• Written in Java but tests are configured in XML or via GUI

• Tests HTTP, HTTPS, SOAP, REST, JDBC, and more

• Includes a web recorder

https://jmeter.apache.org

23

24

Page 15: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

13

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 25@CoverosGene #STARCANADA

Apache JMeter

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 26@CoverosGene #STARCANADA

Types of Performance Testing

• Load testing

• Stress testing

• Scalability testing

• Spike testing

• Endurance testing

•Concurrency testing

•Capacity testing

25

26

Page 16: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

14

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 27@CoverosGene #STARCANADA

Testing Pyramid

Unit Testing

Functional Testing

End-

to-end

Testing

Unit test times, isolated load tests

Full-blown transaction numbers via the UI,

endurance, capacity, and scalability

Baseline and trends of a representative

selection of functional tests

Load testing via the API

User performance testing,

concurrency, stress, and spike testing

Load testing via the UI

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 28@CoverosGene #STARCANADA

Unit Test Performance• Performance of unit tests on

critical logic can catch changes in performance early.

• Repeat each test to create a baseline and assume some variation in runtimes.

• For example,if it usually takes 4.5s, you might fail at 5s or 6s

27

28

Page 17: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

15

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 29@CoverosGene #STARCANADA

Key Takeaway• Remember the testing pyramid.

Use a mix of isolated and end-to-end and in between.

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 30@CoverosGene #STARCANADA

Trends- not just absolute numbers• Short JMeter or Gatling test

• On development system, no isolation• 10 concurrent users for 10 minutes• Track the trend• Are we getting slower or faster?

• Full load and performance test• Dedicated environment, no other traffic• Production-sized servers• 1,000 concurrent users for 1 hour• What is the sustained capacity and throughput?

29

30

Page 18: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

16

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 31@CoverosGene #STARCANADA

JMeter Database Testing• Used pgBadger to analyze PostgreSQL query logs

• 4 queries represented 85% of the traffic

• Wrote 4 JDBC Sampler tests in JMeter to match those queries• Looping in roughly the same proportion

• Created baseline, then watched trends

• Database changes were tested for performance impacts

http://pgbadger.darold.net

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 32@CoverosGene #STARCANADA

Key Takeaway• Shift performance testing left. Get a baseline as early as possible.

• Trends may be easier to test for and just as actionable as absolute performance numbers.

31

32

Page 19: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

17

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 33@CoverosGene #STARCANADA

Testing is not enough• Don't let performance be optional.

• Pick a performance metric,make it a quality gate,fail builds that do not pass.

• If you don't enforce it, it will be ignored.

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 34@CoverosGene #STARCANADA

Key Takeaway• Break the build if you know something is too slow.

33

34

Page 20: How!Fast!Is!My!App?Performance Testing101!€¦ · Page Loading Performance •Users are selfish when it comes to page loading times. They don't care what is slowing it down or why,

11/21/2019

18

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 35@CoverosGene #STARCANADA

#Coveros5• If the user says the page is loading too slowly for them,

it is loading too slowly for them. No matter how fast it is.

• Performance testing is a field, not a particular kind of test. Understand what you are trying to test for.

• Remember the testing pyramid. Use a mix of isolated and end-to-end and in between.

• Trends may be easier to test for and just as actionable as absolute performance numbers.

• Break the build if you know it is too slow.

© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 36@CoverosGene #STARCANADA

Questions?https://hub.techwell.com/

@Gene Gotimer

[email protected]

@CoverosGene

35

36