Is a non-functional testing approach to ensure that the application and the isolated elements of it will perform well under expected workload.
The performance testing get the measure of:
- Speed
- Scalability
- Stability
- Load testing
Simulate user load, anticipate users loads, the objective is identifity bottlenecks
- Stress testing
This involves testing the application under extreme workloads and analyze how it handles the traffic, the objective is identify breaking points
- Endurance testing
It's done to validate if the application can handle the expected load for long periods of time
- Spike testing
It simulates large spikes in the load generated y the users
- Volume testing
Large number of data is populated in the database and overall software, the objective is testing with bit volume of data and the letting ob database volumes
-
What is our anticipated average number of users (normal load)?
-
What is our anticipated peak number of users?
-
When is a good time to load-test our application (i.e. off-hours or week-ends), bearing in mind that this may very well crash one or more of our servers?
-
Does our application have state? If so, how does our application manage it (cookies, session-rewriting, or some other method)?
-
What is the testing intended to achieve?
- Thread group: It is the way to simulate users, it's a root element where located the components and functions to be tested
- 404 Bad request
- 200 OK
- Sessions IDS
- Tokes and keys
- State context of application
- Others values
- Ids
- Objects
- Dynamics values to test
Use one depend of the context
- JavaScript
- Commons Jexl
- Groovy (OOP)
- No obsolesce
- Don't think in GUI mode
- Prepare the reports to use before to execute
- Variables and properties
- Use jmeter functions
- Always execute the real test in a Stage of performance and using command mode
- Execute some threads to test locally
-
Test plan: Is the element that contains the configuration and elements necessary to execute the test
-
Thread group: It the root element that contains samplers, controllers and go on and on. This is considered the beginning point of a test plan.
-
Controlers:
3.1. Samplers: Are different types of requests send by the thread group
- FTP
- HTPP
- JDBC
- SMTP
3.2. Logic controlers: Let you customize the logic that JMeter uses to decide when to send requests.
- Once Only Controller
- Interleave Controller
3.2.1 **Recroding controller : **
- Listeners : Show the results of test execution, is like the reporting
Listeners provide access to the information JMeter gathers about the test cases while JMeter runs. The Graph Results listener plots the response times on a graph
-
Configuration elements: Here we put variables, defaults variables
-
Assertions: The way to validate the response, body, headers, time, status code of each test
Assertions allow you to assert facts about responses received from the server being tested. Using an assertion, you can essentially "test" that your application is returning the results you expect it to.
- Timers:
By default, a JMeter thread executes samplers in sequence without pausing. We recommend that you specify a delay by adding one of the available timers to your Thread Group
- Pre-Processor Elements
A Pre-Processor executes some action prior to a Sampler Request being made.
- Post-Processor Elements
A Post-Processor executes some action after a Sampler Request has been made
- Execution order
-
- Configuration elements
-
- Pre-Processors
-
- Timers
-
- Sampler
-
- Post-Processors (unless SampleResult is null)
-
- Assertions (unless SampleResult is null)
-
- Listeners (unless SampleResult is null)
This elements are used to catch and store the results for example:
- Agreggarte result listener
- Graph result
- View results in table
- View results in tree
Variables don't have to vary - they can be defined once, and if left alone, will not change value
HOST ${__P(host,www.example.com)}
THREADS
- Use Console to developers in Chorme or Firefox to view and debug the transactions
jmeter -Jhost=www.host.com -Jthreads=100 -n -t testfile -l file.jtl -e -o report-output/report