What is the main goal of load testing in performance testing?
Think about testing the system under typical usage conditions.
Load testing measures system behavior under expected normal user load to ensure it performs well during regular use.
What will be the output of this Python code snippet simulating a simple response time measurement?
import time start = time.time() time.sleep(0.5) end = time.time() response_time = end - start print(round(response_time, 1))
Consider how long time.sleep(0.5) pauses the program.
The code pauses for 0.5 seconds, so the response time measured will be approximately 0.5 seconds.
Which assertion correctly checks that the throughput is at least 100 requests per second?
throughput = get_throughput()
# Insert assertion hereThink about including the minimum acceptable throughput value.
The assertion must allow throughput equal to or greater than 100, so using >= is correct.
A performance test report shows high CPU usage but low memory usage and slow response times. What is the most likely bottleneck?
High CPU usage often means the processor is overloaded.
High CPU usage with slow responses indicates the CPU is the bottleneck limiting performance.
You need to perform stress testing on a web application to find its breaking point under extreme load. Which tool is best suited for this task?
Look for a tool that can simulate many users and measure performance under load.
Apache JMeter is designed for performance and stress testing with the ability to simulate heavy loads and generate reports.