0
0
Testing Fundamentalstesting~20 mins

Performance metrics (response time, throughput) in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Performance Metrics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Response Time

Which of the following best describes response time in performance testing?

AThe total time taken to complete all requests in a test.
BThe time taken for a system to respond to a single request.
CThe number of requests processed per second.
DThe amount of data transferred during the test.
Attempts:
2 left
💡 Hint

Think about how long a user waits after making a request.

Predict Output
intermediate
1:30remaining
Calculating Throughput

Given the following test results, what is the throughput (requests per second)?

total_requests = 500
total_time_seconds = 50
throughput = total_requests / total_time_seconds
print(throughput)
Testing Fundamentals
total_requests = 500
total_time_seconds = 50
throughput = total_requests / total_time_seconds
print(throughput)
A500.0
B0.1
C10.0
D50.0
Attempts:
2 left
💡 Hint

Divide total requests by total time in seconds.

assertion
advanced
2:00remaining
Validating Response Time Threshold

Which assertion correctly checks that the response time is less than 2 seconds in a test script?

Testing Fundamentals
response_time = 1.8  # seconds
Aassert response_time < 2
Bassert response_time > 2
Cassert response_time == 2
Dassert response_time >= 2
Attempts:
2 left
💡 Hint

We want to confirm response time is under the limit.

🔧 Debug
advanced
2:00remaining
Identifying Throughput Calculation Error

Find the error in this throughput calculation code snippet:

total_requests = 1000
total_time_seconds = 0
throughput = total_requests / total_time_seconds
print(throughput)
AThroughput will be zero because total_requests is too high.
BNo error; throughput will print 1000.
CSyntax error due to missing colon.
DDivision by zero error because total_time_seconds is zero.
Attempts:
2 left
💡 Hint

Check if dividing by zero is possible.

framework
expert
2:30remaining
Choosing the Best Metric for Load Testing

In a load test simulating 1000 users, which metric best indicates how many requests the system handles per second?

AThroughput
BResponse time
CError rate
DCPU usage
Attempts:
2 left
💡 Hint

Think about the number of requests processed over time.