Performance Testing With Jmeter


Published on

These are the slides I used to introduce students in my Testing Project course ( to Performance Testing and the JMeter ( tool. Of course I cannot upload the hour long walkthrough of the tool as we created a Test Plan for the project but the slides are better than nothing.

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

No notes for slide
  • Performance Testing With Jmeter

    1. 1. Performance Testing with JMeter Adam Goucher [email_address]
    2. 2. Lecture Objective <ul><li>Give students an introduction to performance testing concepts and implementation using JMeter. </li></ul>
    3. 3. Definitions
    4. 4. Performance Testing <ul><li>Performance testing determines or validates the speed of the AUT (X per T) </li></ul>
    5. 5. Load Testing <ul><li>Load testing identifies the maximum operating capacity of an application as well as any bottlenecks that might interfere with its operating at capacity </li></ul><ul><li>(Or, when does it blow up?) </li></ul>
    6. 6. Stress Testing <ul><li>Stress testing is focused on determining an application’s robustness, availability, and reliability under extreme conditions </li></ul><ul><li>heavy loads </li></ul><ul><li>high concurrency </li></ul><ul><li>limited computational resources </li></ul>
    7. 7. Scalability <ul><li>Scalability testing determines or validates whether adding another Y resource (database, memory, disk, CPU, etc) increases speed of X proportionally </li></ul>
    8. 8. Pre-testing Activities
    9. 9. Design Review <ul><li>The cheapest performance issues to address are ones that are never put into the code. </li></ul><ul><li>Testers should review the application design to see if there are any obvious potential performance problems. </li></ul>
    10. 10. Environment Prep - Network <ul><li>Performance testing is often a network intensive activity which can affect others in the organization </li></ul><ul><li>Testing should be done on a separate, segregated network. </li></ul>
    11. 11. Environment Prep - Hardware <ul><li>Depending on what your goals are for your testing, different hardware is appropriate for both the AUT and load generators. </li></ul><ul><li>Testers should acquire and configure the correct hardware. </li></ul>
    12. 12. Environment Prep - Software <ul><li>Generating load is not as easy as it sounds. </li></ul><ul><li>Testers should acquire or create load generators and configure them for their desired goal </li></ul>
    13. 13. Mission <ul><li>Performance testing without a Mission is just throwing load at a server to see what is going to happen. </li></ul><ul><li>Testers should determine Why they are doing their testing. </li></ul>
    14. 14. Audience <ul><li>Determining who you are generating numbers for, will largely dictate what you do </li></ul><ul><li>Development </li></ul><ul><li>Marketing </li></ul><ul><li>Operations </li></ul>
    15. 15. Metrics <ul><li>Performance testing is all about numbers and metrics. </li></ul><ul><li>Testers should determine which metrics they are concerned about and how to get them. </li></ul>
    16. 16. Give Warning <ul><li>Let anyone who might be affected by your testing advance warning. </li></ul>
    17. 17. Generic Testing Steps <ul><li>Create / Record Test </li></ul><ul><li>Add measurement hooks </li></ul><ul><li>Data drive script </li></ul><ul><li>Add logging </li></ul><ul><li>Build workload profile </li></ul><ul><li>Execute test </li></ul>
    18. 18. JMeter
    19. 19. JMeter <ul><li>JMeter is a free, open-source performance measurement tool written in Java </li></ul>
    20. 20. Thread Groups <ul><li>The Thread Group is the basic element of a JMeter Test Plan </li></ul><ul><li>Each thread represents a user  setting a thread group to 1000 simulates 1000 users </li></ul>
    21. 21. Samplers <ul><li>Samplers do the actual work in JMeter and interact with the server you are loading </li></ul><ul><li>There are a number Samplers in JMeter by default. For web testing, use ‘HTTP Request' </li></ul>
    22. 22. Listeners <ul><li>The information produced by Samplers is consumed by Listeners </li></ul><ul><li>Popular listeners are: </li></ul><ul><li>Graph Results </li></ul><ul><li>View Results Tree </li></ul><ul><li>Simple Data Writer </li></ul>
    23. 23. Logic Controllers <ul><li>Logic Controllers determine the order that Samplers are processed </li></ul><ul><li>More complex scripts will make use of </li></ul><ul><li>Loops </li></ul><ul><li>Interleave </li></ul><ul><li>Random </li></ul><ul><li>If </li></ul>
    24. 24. Assertions <ul><li>A test isn’t a test unless it checks something. Assertions are what do the checking </li></ul><ul><li>For web applications, these are the useful ones </li></ul><ul><li>Response </li></ul><ul><li>Duration </li></ul><ul><li>HTML Assertion </li></ul>
    25. 25. Configuration Elements <ul><li>Configuration Elements set default values for other parts of the Test Plan as well as configure variables </li></ul><ul><li>CSV Data Set Config allows you do to DDT within JMeter </li></ul><ul><li>HTTP Cookie Manager will automatically intercept and sent cookies with requests </li></ul><ul><li>HTTP Request Defaults saves you time when doing lots of HTTP Samplers </li></ul>
    26. 26. Variables <ul><li>In JMeter, you can reference variables as such </li></ul><ul><li>${VARIABLE} </li></ul>
    27. 27. Batch <ul><li>JMeter can run in a non-gui mode to save resources on the load generating machines </li></ul>
    28. 28. Recording <ul><li>There is a way to record tests (as in LoadRunner) but I find it easier to build scripts one element at a time </li></ul>