0
0
Testing Fundamentalstesting~10 mins

Risk analysis for testing 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 define the risk level based on impact.

Testing Fundamentals
risk_level = 'High' if impact [1] 7 else 'Low'
Drag options to blanks, or click blank then click option'
A<
B==
C>=
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>=' causes the risk level to be set incorrectly.
Using '==' only checks for exactly 7, missing higher impacts.
2fill in blank
medium

Complete the code to calculate risk priority by multiplying probability and impact.

Testing Fundamentals
risk_priority = probability [1] impact
Drag options to blanks, or click blank then click option'
A*
B/
C-
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' adds values but does not reflect combined risk properly.
Using '/' or '-' changes the meaning and results in incorrect priority.
3fill in blank
hard

Fix the error in the risk assessment function to return correct risk level.

Testing Fundamentals
def assess_risk(probability, impact):
    if probability [1] 0.7 and impact >= 7:
        return 'High'
    else:
        return 'Low'
Drag options to blanks, or click blank then click option'
A>=
B<
C<=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<=' reverses the logic and causes wrong risk classification.
Using '==' only matches exactly 0.7, missing higher probabilities.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps test cases to risk levels based on priority.

Testing Fundamentals
risk_map = {test_case: 'High' if priority [1] 50 else 'Low' for test_case, priority in test_priorities.items() if priority [2] 10}
Drag options to blanks, or click blank then click option'
A>=
B<
C>
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>=' in the first blank reverses risk assignment.
Using '>=' instead of '<' in the second blank includes wrong priorities.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of test cases with risk priority above threshold and label them.

Testing Fundamentals
filtered_risks = { [1]: priority for [2], priority in risks.items() if priority [3] threshold }
Drag options to blanks, or click blank then click option'
Atest_case
Btest
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' in the last blank filters the wrong priorities.
Mixing variable names causes confusion and errors.