Bird
Raised Fist0
Testing Fundamentalstesting~10 mins

Risk analysis for testing in Testing Fundamentals - Test Execution Trace

Choose your learning style10 modes available
Test Overview

This test simulates a risk analysis process for a software feature. It verifies that high-risk areas are identified and prioritized for testing to reduce potential failures.

Test Code - PyTest
Testing Fundamentals
def risk_analysis(features):
    # Assign risk scores based on impact and likelihood
    risk_scores = {}
    for feature, data in features.items():
        impact = data.get('impact', 0)
        likelihood = data.get('likelihood', 0)
        risk_scores[feature] = impact * likelihood
    # Sort features by risk descending
    prioritized = sorted(risk_scores.items(), key=lambda x: x[1], reverse=True)
    return prioritized


def test_risk_analysis():
    features = {
        'login': {'impact': 9, 'likelihood': 8},
        'search': {'impact': 6, 'likelihood': 5},
        'profile_update': {'impact': 7, 'likelihood': 3},
        'notifications': {'impact': 4, 'likelihood': 2}
    }
    result = risk_analysis(features)
    expected_first = ('login', 72)  # 9*8
    assert result[0] == expected_first, f"Expected highest risk feature to be {expected_first}, got {result[0]}"
    assert result[-1][0] == 'notifications', "Expected lowest risk feature to be 'notifications'"
Execution Trace - 7 Steps
StepActionSystem StateAssertionResult
1Test startsTest environment ready, risk_analysis function and test_risk_analysis defined—PASS
2test_risk_analysis() is calledFeatures dictionary with impact and likelihood values passed to risk_analysis—PASS
3risk_analysis calculates risk scores for each featureRisk scores computed: login=72, search=30, profile_update=21, notifications=8—PASS
4risk_analysis sorts features by risk descendingSorted list: [('login', 72), ('search', 30), ('profile_update', 21), ('notifications', 8)]—PASS
5test_risk_analysis asserts highest risk feature is 'login' with score 72First item in result is ('login', 72)assert result[0] == ('login', 72)PASS
6test_risk_analysis asserts lowest risk feature is 'notifications'Last item in result is ('notifications', 8)assert result[-1][0] == 'notifications'PASS
7Test ends successfullyAll assertions passed, risk analysis prioritization verified—PASS
Failure Scenario
Failing Condition: If risk scores are calculated incorrectly or sorting fails
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify about the 'login' feature?
AIt has the lowest risk score
BIt is not included in the risk analysis
CIt has the highest risk score
DIt has the same risk score as 'search'
Key Result
Performing risk analysis helps testers focus on the most critical features first, improving test efficiency and reducing chances of major failures.

Practice

(1/5)
1. What is the main purpose of risk analysis in software testing?
easy
A. To write code faster without testing
B. To identify which parts of the software need testing first based on potential problems
C. To create user manuals for the software
D. To design the software's user interface

Solution

  1. Step 1: Understand risk analysis goal

    Risk analysis helps testers find which parts of software might cause big problems.
  2. Step 2: Connect goal to testing order

    Testing starts with high-risk areas to catch serious issues early.
  3. Final Answer:

    To identify which parts of the software need testing first based on potential problems -> Option B
  4. Quick Check:

    Risk analysis = prioritize testing by risk [OK]
Hint: Risk analysis = test high-risk parts first [OK]
Common Mistakes:
  • Thinking risk analysis is about coding speed
  • Confusing risk analysis with documentation
  • Believing risk analysis designs UI
2. Which of the following is a correct way to describe risk in testing?
easy
A. Risk is the chance that a feature will be easy to use
B. Risk is how fast the software runs
C. Risk is the likelihood and impact of a problem occurring in the software
D. Risk means the software will never have bugs

Solution

  1. Step 1: Define risk in testing context

    Risk means how likely a problem is and how bad its effect would be.
  2. Step 2: Match definition to options

    Risk is the likelihood and impact of a problem occurring in the software correctly states risk as likelihood and impact of problems.
  3. Final Answer:

    Risk is the likelihood and impact of a problem occurring in the software -> Option C
  4. Quick Check:

    Risk = likelihood + impact [OK]
Hint: Risk = chance x impact of problem [OK]
Common Mistakes:
  • Confusing risk with software speed
  • Thinking risk means no bugs
  • Mixing risk with usability
3. Given the following risk scores for features, which feature should be tested first?
Feature A: Impact=5, Likelihood=2
Feature B: Impact=3, Likelihood=4
Feature C: Impact=4, Likelihood=4
Feature D: Impact=2, Likelihood=5
medium
A. Feature C
B. Feature B
C. Feature A
D. Feature D

Solution

  1. Step 1: Calculate risk scores

    Multiply impact and likelihood for each feature:
    Feature A: 5x2=10
    Feature B: 3x4=12
    Feature C: 4x4=16
    Feature D: 2x5=10
  2. Step 2: Identify highest risk

    Feature C has the highest risk score (16), so test it first.
  3. Final Answer:

    Feature C -> Option A
  4. Quick Check:

    Highest risk = Feature C (16) [OK]
Hint: Test feature with highest impact x likelihood first [OK]
Common Mistakes:
  • Choosing feature with highest impact only
  • Choosing feature with highest likelihood only
  • Adding instead of multiplying impact and likelihood
4. A tester assigned risk scores as Impact=3 and Likelihood=5 for a feature. Later, they realize the impact should be 5, but they forgot to update the risk score. What is the error in their risk analysis?
medium
A. Incorrect calculation of risk score due to outdated impact value
B. Wrong likelihood value used
C. Risk analysis does not require impact values
D. Risk score should be ignored if updated values are missing

Solution

  1. Step 1: Identify the mistake in risk scoring

    The tester used an old impact value (3) instead of the correct one (5).
  2. Step 2: Understand effect on risk score

    This causes the risk score to be too low, leading to wrong testing priority.
  3. Final Answer:

    Incorrect calculation of risk score due to outdated impact value -> Option A
  4. Quick Check:

    Outdated impact causes wrong risk score [OK]
Hint: Always update impact and likelihood before scoring [OK]
Common Mistakes:
  • Ignoring impact changes
  • Assuming likelihood was wrong
  • Thinking risk score can be skipped
5. You have three features with these risk values:
Feature X: Impact=4, Likelihood=3
Feature Y: Impact=5, Likelihood=2
Feature Z: Impact=3, Likelihood=5

If testing time is limited and you can only test two features, which two should you pick to maximize risk coverage?
hard
A. Feature Y and Feature Z
B. Feature X and Feature Y
C. Feature X and Feature Y and Feature Z
D. Feature X and Feature Z

Solution

  1. Step 1: Calculate risk scores for all features

    Feature X: 4x3=12
    Feature Y: 5x2=10
    Feature Z: 3x5=15
  2. Step 2: Select two features with highest combined risk

    Feature Z (15) and Feature X (12) together cover 27 risk points, higher than other pairs.
  3. Final Answer:

    Feature X and Feature Z -> Option D
  4. Quick Check:

    Pick top two risk scores for best coverage [OK]
Hint: Pick two features with highest risk scores combined [OK]
Common Mistakes:
  • Choosing features with highest impact only
  • Selecting features with lowest risk
  • Trying to test all three when time is limited
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard