0
0
Testing Fundamentalstesting~10 mins

Performance test reporting in Testing Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the total time taken for the performance test.

Testing Fundamentals
print('Total test time:', [1], 'seconds')
Drag options to blanks, or click blank then click option'
Aelapsed_time
Btotal_time
Ctest_duration
Drun_time
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name that does not exist or is unrelated to time.
2fill in blank
medium

Complete the code to calculate the average response time from the list of response times.

Testing Fundamentals
average_time = sum(response_times) [1] len(response_times)
Drag options to blanks, or click blank then click option'
A/
B*
C+
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication or addition instead of division.
3fill in blank
hard

Fix the error in the assertion that checks if the maximum response time is below the threshold.

Testing Fundamentals
assert max(response_times) [1] threshold, 'Response time too high!'
Drag options to blanks, or click blank then click option'
A>=
B<=
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using greater than or equal operators which invert the logic.
4fill in blank
hard

Fill both blanks to create a dictionary of response times for each user where times are greater than 100ms.

Testing Fundamentals
slow_responses = {user: [1] for user, [2] in responses.items() if max(times) > 100}
Drag options to blanks, or click blank then click option'
Atimes
Btime
Ctimes_list
Dtime_list
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names causing errors.
5fill in blank
hard

Fill all three blanks to create a report dictionary with user names in uppercase, their average response time, and only include users with average below 200ms.

Testing Fundamentals
report = {user[1]: sum(times)[2]len(times) for user, times in data.items() if (sum(times)[3]len(times)) < 200}
Drag options to blanks, or click blank then click option'
A.upper()
B/
D.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using .lower() instead of .upper().
Using multiplication or addition instead of division for average.