Top Ten Secret Weapons For Agile Performance Testing


Published on

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • In a conventional project, we focus on the functionality that needs to be delivered.Performance might be important, but performance requirements are considered quite separate from functional requirements.One approach is to attach “conditions” to story cards, i.e. this functionality must handle a certain load.In our experience, where performance is of critical conern, pull out the performance requirement as its own story…
  • Calling out performance requirements as their own stories allows you to:validate the benefit you expect from delivering the performance-prioritise performance work against other requirements-know when you’re done
  • not sure if you like this picture, I was really looking for a good shot looking out over no-man’s land at the Berlin wall.I want the idea of divisions along skill lines breading hostility and un-cooperation.
  • Everything should be based on some foreseeable scenario, and who benefits from itHarder to do without repetition (involvement and feedback) [not sure if this makes sense anymore]Extremely important to keep people focused as its easy to driftCapture different profilesSeparation simulation from optimisation -> Problem Identification vs Problem Resolution (or broken down further Solution Brainstorm -> Solution Investigation)Linking back to why is even more essential -> map to existing problems or fearsLatency vs throughput -> determine what is the most useful metric and define service level agreements
  • sure which one you like better
  • Here’s an example... (in the style of Feature Injection) “What’s our upper limit?”
  • Here’s another example... (in the style of Feature Injection), “Can we handle peaks in traffic again?”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
  • It helps to be clear about who is going to benefit from any performance testing (tuning and optimisation) that is going to take place. Ensure that they get a stake on prioritisation that will help with the next point...
  • Evidence-based decision-making. Don’t commit to a code change until you know it’s the right thing to do.
  • Evidence-based decision-making. Don’t commit to a code change until you know it’s the right thing to do.
  • It helps to have the customer (mentioned in the previous slide) be a key stakeholder to prioritise.
  • Application supports better ability to be performance tested easierLike TDD changes the design/architecture of a systemNeed to find reference for thisMeasuring it early helps raise what changes contribute to slownessPerformance work takes longerLead times potentially large and long lead time (sequential) – think of where gantt chart may actually be usefulRun it as a parallel track of work to normal functionality (not sequential)Minimal environment availability (expensive, non concurrent use)Need minimal functionality or at least clearly defined interfaces to operate againstWant to have some time to respond to feedback -> work that into the process as early as possible and potentially change architecture/design
  • Start with the simplest performance test scenarios -> Sanity test/smoke test-> Hit all aspects-> Use to drive out automated deployment (environment limitations, configuration issues, minimal set of reporting needs – green/red)-> Hit integration boundaries but with a small problem rather than everythingNext story might be a more complex script or something that drives out more of the infrastrcutrePerformance stories should not be :-> Build out tasks-> Does not enhance anything without other storiesLog files -> Contents early. Consumer Driven. Contracts for analysis. Keep around. Keep notes around what was variedINVEST storiesAvoid the large “performance test” storySeparate types of storiesOptimise vs MeasureOptimise is riskier components. Less known. “Done” is difficult to estimateMeasure is clearer. Allows you to make better informed choicesKnow when to stopWhen enough is enough
  • The best lessons are learned from iterating, not from incrementing. Iterate over your performance test harness, framework and test fixtures. Make it easier to increment into new areas by incrementing in a different direction each time. - Start with simple performance test scenarios - Don’t build too much infrastructure at once - Refine the test harness and things used to create more tests - Should always be delivering value - Identify useful features in performance testing and involve the stakeholder(s) to help prioritise them inPrioritise and schedule in analysis stories (metrics and graphs)Some of this work will still be big
  • Sashimi is nice and bite sized. You don’t eat the entire fish at once. You’re eating a part of it. Sashimi slices are nice and thin. There are a couple of different strategies linking this in. Think of sashimi as the thinnest possible slice.
  • Number of requests over time
  • Latency over time
  • “I don’t want to click through to each graph”
  • “I don’t want to click through to each graph”
  • “I don’t want to click through to each graph”
  • Automated build is a key XP practice.The first stage of automating a build is often to automate compilationHowever, for a typical project, we go on after compilation to run tests, as another automated step.In fact we may have a whole series of automted steps that chain on after each other, automating many aspects of the development process, all the way from compiling source to to deploying a complete application into the production environment.
  • Automation is powerful lever in software projects because:it gives us reproducable, consistent processesWe get faster feedback when something goes wrongOverall higher productivity – we can repeat an automated build much more often than we could if it was manual
  • In performance testing we can use automate many of the common tasks in a similar way to how we automate a software build.For any performance test, there is a linear series of activities that can be automated (first row of slide)In our recent projects we’ve been using the build tool ant for most of performance scripting. You could use any scripting language, but here are some very basic scripts to show you the kind of thing we mean… [possibly animate transitions to the 4 following slides]Once we’ve auomted the running of a single test, we can move on even more aspects of automation such as scheduling and result archiving, whch lead us into…Continuous Performance testing.
  • For a faster feedback, set up your CI server so that performance tests are always running against the latest version of the application.
  • Top Ten Secret Weapons For Agile Performance Testing

    1. 1. Top ten secret weapons for agile performance testing<br />by Patrick Kua<br /><br /><br />© ThoughtWorks2010<br />
    2. 2. Make Performance Explicit<br />© ThoughtWorks2010<br /> 1<br />
    3. 3. So that I can make better investment decisions<br />As an investor<br />I want to see the value of my portfolio presented on a single web page<br />must have “good” performance, less than 0.2s page load for about 10,000 concurrent users<br />© ThoughtWorks2010<br />
    4. 4. © ThoughtWorks2010<br />So that investors have a high-quality experience as the business grows<br />As the Operations Manager<br />I want the portfolio value page to render within 0.2s when 10,000 users are logged in<br />
    5. 5. One Team<br />© ThoughtWorks2010<br /> 2<br />
    6. 6. Team Dynamics<br />© ThoughtWorks2010<br />
    7. 7. Performance Testers Part of Team<br />© ThoughtWorks2010<br />
    8. 8. © ThoughtWorks2010<br />
    9. 9. Performance Testers Part of Team<br />© ThoughtWorks2010<br />
    10. 10. Pair on Performance Test Stories<br />© ThoughtWorks2010<br />
    11. 11. Rotate Pairs<br />© ThoughtWorks2010<br />
    12. 12. Customer Driven<br />© ThoughtWorks2010<br /> 3<br />
    13. 13. What was a good source of requirements?<br />© ThoughtWorks2010<br />
    14. 14. © ThoughtWorks2010<br />Existing Pain Points<br />
    15. 15. An example...<br />© ThoughtWorks2010<br />
    16. 16. So that we can budget for future hardware needs as we grow<br />As the data centre manager<br />I want to know how much traffic we can handle now<br />© ThoughtWorks2010<br />
    17. 17. Another example<br />© ThoughtWorks2010<br />
    18. 18. © ThoughtWorks2010<br />So that we have confidence in meeting our SLA<br />As the Operations Manager<br />I want to ensure that a sustained peak load does not take out our service<br />
    19. 19. Personas<br />© ThoughtWorks2010<br />
    20. 20. Who is the customer?<br />© ThoughtWorks2010<br />Investors<br />Marketing<br />End Users<br />Power <br />Users<br />Operations<br />
    21. 21. Discipline<br />© ThoughtWorks2010<br /> 4<br />
    22. 22. © ThoughtWorks2010<br />Observe test results<br />What do you see?<br />Formulate an hypothesis<br />Why is it doing that?<br />Design an experiment<br />How can I prove that’s what’s happening?<br />Run the experiment<br />Take the time to gather the evidence.<br />Is the hypothesis valid?<br />Change the application code<br />Safe in the knowledge that I’m making it faster<br />
    23. 23. ??????????<br />© ThoughtWorks2010<br />
    24. 24. © ThoughtWorks2010<br />Observe test results<br />Saw tooth pattern (1 minute intervals)<br />Formulate an hypothesis<br />Directory structure of (yyyy/mm/minuteofday)?. Slow down due to # of files in directory?<br />Design an experiment<br /> 1 directory should result in even worse performance...<br />Run the experiment<br />We ran the test…<br />Is the hypothesis valid?<br />Change the application code<br />
    25. 25. One Directory<br />© ThoughtWorks2010<br />
    26. 26. Play Performance Early<br />© ThoughtWorks2010<br /> 5<br />
    27. 27. © ThoughtWorks2010<br />End<br />Start<br />Other projects start performance testing here<br />End<br />Start<br />Agile projects start performance testing as early as possible<br />
    28. 28. Iterate Don’t (Just) Increment<br />© ThoughtWorks2010<br /> 6<br />
    29. 29. © ThoughtWorks2010<br />
    30. 30. We Sashimi<br />© ThoughtWorks2010<br />
    31. 31. Sashimi Slice By... Presentation<br />© ThoughtWorks2010<br />
    32. 32. © ThoughtWorks2010<br />So that I can better see trends in performance<br />As the Operations Manager<br />I want a graph of requests per second<br />
    33. 33. © ThoughtWorks2010<br />So that I can better see trends in performance<br />As the Operations Manager<br />I want a graph of average latency per second<br />
    34. 34. © ThoughtWorks2010<br />So that I can easily scan results at a single glance<br />As the Operations Manager<br />I want a one page showing all results <br />
    35. 35. Sashimi Slice By... Scenario<br />© ThoughtWorks2010<br />
    36. 36. © ThoughtWorks2010<br />So that we never have a day like “October 10”<br />As the Operations Manager<br />I want to ensure that a sustained peak load does not take out our service<br />
    37. 37. © ThoughtWorks2010<br />So that we never have a day like “November 12”<br />As the Operations Manager<br />I want to ensure that an escalating load up to xxx requests/second does not take out our service<br />
    38. 38. Automate, Automate, Automate<br />© ThoughtWorks2010<br /> 7<br />
    39. 39. © ThoughtWorks2010<br />Automated<br />Compilation<br />Automated<br />Tests<br />Automated<br />Packaging<br />Automated<br />Deployment<br />
    40. 40. Automation =&gt; Reproducible and Consistent<br />Automation =&gt; Faster Feedback<br />Automation =&gt; Higher Productivity<br />Why Automation?<br />© ThoughtWorks2010<br />
    41. 41. © ThoughtWorks2010<br />Automated<br />Test Orchestration<br />Automated<br />Analysis<br />Automated Scheduling<br />Automated<br />Load Generation<br />Automated<br />Application Deployment<br />Automated Result Archiving<br />
    42. 42. Continuous Performance Testing<br />© ThoughtWorks2010<br /> 8<br />
    43. 43. Application<br />Build Pipelines<br />© ThoughtWorks2010<br />Performance<br />
    44. 44. © ThoughtWorks2010<br />
    45. 45. Test Drive Your Performance Test Code<br />© ThoughtWorks2010<br /> 9<br />
    46. 46. V Model Testing<br />© ThoughtWorks2010<br />Slower + Longer<br />Performance Testing<br />Speed<br />Fast<br /><br />
    47. 47. We make mistakes<br />© ThoughtWorks2010<br />
    48. 48. V Model Testing<br />© ThoughtWorks2010<br />Slower + Longer<br />Performance Testing<br />Speed<br />Unit test performance code to fail faster<br />Fast<br /><br />
    49. 49. Classic Performance Areas to Test<br />© ThoughtWorks2010<br />Analysis<br />Information Collection<br />Presentation<br />Publishing<br />Visualisation<br />
    50. 50. Get Feedback<br />© ThoughtWorks2010<br />10<br />
    51. 51. Frequently (Weekly) Showcase<br />© ThoughtWorks2010<br />Here is what we learned this week....<br />
    52. 52. Frequently (Weekly) Showcase<br />© ThoughtWorks2010<br />And based on this... We changed our directory structure.<br />
    53. 53. Frequently (Weekly) Showcase<br />© ThoughtWorks2010<br />Should we do something different knowing this new information?<br />
    54. 54. List of All Secret Weapons<br />Make Performance Explicit<br />One Team<br />Customer Driven<br />Discipline<br />Play Performance Early<br />Iterate Don&apos;t (Just) Increment<br />Automate, Automate, Automate <br />Test Drive Your Performance Code<br />Continuous Performance Testing<br />Get Feedback<br />© ThoughtWorks2010<br />
    55. 55. Photo Credits (Creative Commons licence)<br />Barbed wire picture:<br />Eternal clock:<br />Sashimi from<br />Questions? <br />© ThoughtWorks2010<br />