Top ten secret weapons for performance testing in an agile environment

57
Top ten secret weapons for performance testing in an agile environment [email protected] (and [email protected]) © ThoughtWorks 2011

Transcript of Top ten secret weapons for performance testing in an agile environment

Page 1: Top ten secret weapons for performance testing in an agile environment

Top ten secret weapons for performance testing in an agile environment

[email protected](and [email protected])

© ThoughtWorks 2011

Page 2: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Make Performance Explicit

© ThoughtWorks 2011

1

Page 3: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

# So that I can make better investment decisionsAs an investorI want to see the value of my portfolio presented on a single web pagemust have “good” performance, less than 0.2s

page load for about 10,000 concurrent users

© ThoughtWorks 2011

Page 4: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that investors have a high-quality experience as the business growsAs the Operations ManagerI want the portfolio value page to render within 0.2s when 10,000 users are logged in

Page 5: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

One Team

© ThoughtWorks 2011

2

Page 6: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Team Dynamics

Page 7: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Performance Testers Part of Team

Page 8: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Page 9: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Performance Testers Part of Team

Page 10: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Pair on Performance Test Stories

Page 11: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Rotate Pairs

Page 12: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Customer Driven

© ThoughtWorks 2011

3

Page 13: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

What was a good source of requirements?

Page 14: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Existing Pain Points

Page 15: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

An example...

Page 16: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that we can budget for future hardware needs as we growAs the data centre managerI want to know how much traffic we can handle now

Page 17: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Another example

Page 18: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that we have confidence in meeting our SLAAs the Operations ManagerI want to ensure that a sustained peak load does not take out our service

Page 19: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Personas

Page 20: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Who is the customer?End Users

OperationsPower Users

Marketing

Investors

Page 21: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Discipline

© ThoughtWorks 2011

4

Page 22: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Is the hypothesis

valid?

Change the application

code

Observe test results

Formulate an hypothesis

Design an experiment

Run the experiment

What do you see?

Why is it doing that?

How can I prove that’s what’s happening?

Take the time to gather the evidence.

Safe in the knowledge that I’m making it faster

Page 23: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Page 24: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Saw tooth pattern (1 minute intervals)

Directory structure of (yyyy/mm/minuteofday)?. Slow down due to # of files in directory?

1 directory should result in even worse performance...

We ran the test…

Is the hypothesis

valid?

Change the application

code

Observe test results

Formulate an hypothesis

Design an experiment

Run the experiment

Page 25: Top ten secret weapons for performance testing in an agile environment

One Directory

© ThoughtWorks 2011

Page 26: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Play Performance Early

© ThoughtWorks 2011

5

Page 27: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

End

Start End

Other projects start performance testing

here

Start

Agile projects start performance testing as

early as possible

Page 28: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Iterate Don’t (Just) Increment

© ThoughtWorks 2011

6

Page 29: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Page 30: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

We Sashimi

Page 31: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Sashimi Slice By... Presentation

Page 32: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that I can better see trends in performanceAs the Operations ManagerI want a graph of requests per second

Page 33: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that I can better see trends in performanceAs the Operations ManagerI want a graph of average latency per second

Page 34: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that I can easily scan results at a single glanceAs the Operations ManagerI want a one page showing all results

Page 35: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Sashimi Slice By... Scenario

Page 36: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that we never have a day like “October 10”As the Operations ManagerI want to ensure that a sustained peak load does not take out our service

Page 37: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

So that we never have a day like “November 12”As the Operations ManagerI want to ensure that an escalating load up to xxx requests/second does not take out our service

Page 38: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Automate, Automate, Automate

© ThoughtWorks 2011

7

Page 39: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

AutomatedCompilation

AutomatedTests

AutomatedPackaging

AutomatedDeployment

Page 40: Top ten secret weapons for performance testing in an agile environment

Automation => Reproducible and ConsistentAutomation => Faster FeedbackAutomation => Higher Productivity

Why Automation?

© ThoughtWorks 2011

Page 41: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

AutomatedApplication Deployment

AutomatedLoad

Generation

AutomatedTest

Orchestration

AutomatedAnalysis

Automated Scheduling

Automated Result Archiving

Page 42: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Continuous Performance Testing

© ThoughtWorks 2011

8

Page 43: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Page 44: Top ten secret weapons for performance testing in an agile environment

Application

Build Pipelines

© ThoughtWorks 2011

Performance

Page 45: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Page 46: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Test Drive Your Performance Test Code

© ThoughtWorks 2011

9

Page 47: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

V Model Testing

http://en.wikipedia.org/wiki/V-Model_(software_development)

Performance Testing

Slower + Longer

Fast

Speed

Page 48: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

We make mistakes

Page 49: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

V Model Testing

http://en.wikipedia.org/wiki/V-Model_(software_development)

Performance Testing

Slower + Longer

Fast

Speed

Unit test performance

code to fail faster

Page 50: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Fail Fast!

Fast feedback!

Faster learning

Faster results

Page 51: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Classic Performance Areas to Test

Analysis

Information Collection

Visualisation

Publishing

Presentation

Page 52: Top ten secret weapons for performance testing in an agile environment

SECRET

WEAPON

#

Get Feedback

© ThoughtWorks 2011

10

Page 53: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Frequently (Weekly) Showcase

Here is what we learned this week....

Page 54: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Frequently (Weekly) Showcase

And based on this... We changed our directory structure.

Page 55: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Frequently (Weekly) Showcase

Should we do something different knowing this new information?

Page 56: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

List of All Secret Weapons

1. Make Performance Explicit2. One Team3. Customer Driven4. Discipline5. Play Performance Early6. Iterate Don't (Just) Increment7. Automate, Automate, Automate 8. Test Drive Your Performance Code9. Continuous Performance Testing10. Get Feedback

Page 57: Top ten secret weapons for performance testing in an agile environment

© ThoughtWorks 2011

Photo Credits (Creative Commons licence)• Barbed wire picture: http://www.flickr.com/photos/lapideo/446201948/• Eternal clock: http://www.flickr.com/photos/robbie73/3387189144/• Sashimi from http://www.flickr.com/photos/mac-ash/3719114621/

Questions