0
0
Testing Fundamentalstesting~20 mins

Stress testing concepts in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Stress Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of Stress Testing

What is the main goal of stress testing in software testing?

ATo verify if the system meets all functional requirements under normal conditions
BTo check how the system behaves under extreme workloads beyond normal operational capacity
CTo test the system's user interface for usability issues
DTo ensure the system can handle multiple user roles correctly
Attempts:
2 left
💡 Hint

Think about testing limits beyond usual usage.

Predict Output
intermediate
2:00remaining
Stress Test Result Interpretation

Given a stress test script that increases user load until failure, what does a sudden crash at 1500 users indicate?

Testing Fundamentals
max_users = 0
for users in range(100, 2000, 100):
    if system_stress_test(users) == 'fail':
        max_users = users - 100
        break
print(max_users)
AThe system can handle up to 1400 users before failing
BThe system fails at 1500 users but can handle 1600 users
CThe system can handle exactly 1500 users without failure
DThe system fails immediately at 100 users
Attempts:
2 left
💡 Hint

Look at the loop and when it breaks.

assertion
advanced
2:00remaining
Valid Assertion for Stress Test

Which assertion correctly verifies that the system response time stays below 5 seconds under stress?

Testing Fundamentals
response_time = get_response_time_under_load()
# Choose the correct assertion below
Aassert response_time < 5, f"Response time too high: {response_time}s"
Bassert response_time > 5, f"Response time too low: {response_time}s"
Cassert response_time == 5, f"Response time not equal to 5s: {response_time}s"
Dassert response_time != 5, f"Response time equals 5s: {response_time}s"
Attempts:
2 left
💡 Hint

We want to ensure response time is less than 5 seconds.

🔧 Debug
advanced
2:00remaining
Identify the Bug in Stress Test Code

What is the bug in the following stress test code snippet?

Testing Fundamentals
def stress_test(system, max_load):
    load = 0
    while load <= max_load:
        result = system.run(load)
        if result == 'fail':
            break
        load += 10
    return load

final_load = stress_test(my_system, 100)
print(final_load)
AThe loop increments load by 10 instead of 1, causing inaccurate results
BThe break statement is missing, causing an infinite loop
CThe function does not handle exceptions from system.run()
DThe function returns the load value at failure, not the last successful load
Attempts:
2 left
💡 Hint

Check what value is returned when failure occurs.

framework
expert
2:00remaining
Best Practice for Stress Test Automation Framework

Which feature is MOST important to include in a stress test automation framework to ensure reliable results?

ADetailed UI screenshots for every test step
BRandomized test data generation without constraints
CAutomatic recovery and cleanup after each test iteration to reset system state
DManual intervention prompts during test execution
Attempts:
2 left
💡 Hint

Think about maintaining consistent test conditions.