Bird
0
0

A tester wrote this stress test code snippet:

medium📝 Debug Q14 of 15
Testing Fundamentals - Non-Functional Testing
A tester wrote this stress test code snippet:
for i in range(1000, 1100):
    simulate_login(i)
    simulate_data_request(i)
    check_response_time()

What is the main issue in this code?
AThe <code>check_response_time</code> function is missing the user parameter
BThe loop range is incorrect for stress testing
CThe <code>simulate_login</code> function should be outside the loop
DThere is no issue; the code is correct
Step-by-Step Solution
Solution:
  1. Step 1: Review function calls inside the loop

    The loop calls simulate_login(i) and simulate_data_request(i) with the user parameter i. However, check_response_time() is called without any parameter.
  2. Step 2: Identify inconsistency

    Since response time likely depends on the user or request, missing the user parameter in check_response_time() is an error causing incorrect or failed measurement.
  3. Final Answer:

    The check_response_time function is missing the user parameter -> Option A
  4. Quick Check:

    Missing parameter in function call = bug [OK]
Quick Trick: Check all function calls have needed parameters [OK]
Common Mistakes:
  • Ignoring missing parameters in function calls
  • Thinking loop range is wrong for stress testing
  • Assuming functions should be outside the loop

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes