0
0
Testing Fundamentalstesting~20 mins

Risk-based testing in Testing Fundamentals - Practice Problems & Coding Challenges

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

In risk-based testing, which factor is most important when deciding which features to test first?

AThe likelihood of failure and impact on users
BThe complexity of the code implementation
CThe number of developers who worked on the feature
DThe order in which features were developed
Attempts:
2 left
💡 Hint

Think about what risk means in testing: what could go wrong and how bad it would be.

Predict Output
intermediate
2:00remaining
Output of Risk Score Calculation

What is the output of this Python code that calculates risk scores for features?

Testing Fundamentals
features = {'Login': {'likelihood': 0.9, 'impact': 0.8}, 'Search': {'likelihood': 0.4, 'impact': 0.5}}
risk_scores = {f: data['likelihood'] * data['impact'] for f, data in features.items()}
print(risk_scores)
A{'Login': 1.7, 'Search': 0.9}
B{'Login': 0.72, 'Search': 0.2}
C{'Login': 0.9, 'Search': 0.4}
D{'Login': 0.8, 'Search': 0.5}
Attempts:
2 left
💡 Hint

Multiply likelihood by impact for each feature.

assertion
advanced
2:00remaining
Validating Risk Priority Order

Given a list of features with risk scores, which assertion correctly checks that the features are sorted from highest to lowest risk?

Testing Fundamentals
features = [('Login', 0.72), ('Search', 0.2), ('Profile', 0.5)]
sorted_features = sorted(features, key=lambda x: x[1], reverse=True)
Aassert sorted_features[0][1] < sorted_features[-1][1]
Bassert sorted_features == [('Search', 0.2), ('Profile', 0.5), ('Login', 0.72)]
Cassert sorted_features[0][0] == 'Search'
Dassert sorted_features == [('Login', 0.72), ('Profile', 0.5), ('Search', 0.2)]
Attempts:
2 left
💡 Hint

Check that the list is sorted descending by risk score.

🔧 Debug
advanced
2:00remaining
Debugging Risk Score Calculation Error

Why does this code raise a TypeError when calculating risk scores?

Testing Fundamentals
features = {'Login': {'likelihood': '0.9', 'impact': 0.8}}
risk_scores = {f: data['likelihood'] * data['impact'] for f, data in features.items()}
print(risk_scores)
ABecause the print statement is missing parentheses
BBecause the dictionary keys are strings instead of integers
CBecause 'likelihood' is a string and cannot be multiplied by a float
DBecause the dictionary comprehension syntax is incorrect
Attempts:
2 left
💡 Hint

Check the data types of values used in multiplication.

framework
expert
3:00remaining
Designing a Risk-Based Test Suite

You have 5 features with risk scores: A(0.9), B(0.7), C(0.4), D(0.3), E(0.1). You can only write tests for 3 features due to time limits. Which selection best follows risk-based testing principles?

ATest features A, B, and C because they have the highest risk scores
BTest features C, D, and E because they are less complex
CTest features B, D, and E because they were developed last
DTest features A, C, and E to cover a range of risk scores
Attempts:
2 left
💡 Hint

Focus on features with the highest risk scores first.