Bird
Raised Fist0
Testing Fundamentalstesting~20 mins

Defect classification (severity, priority) in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Defect Classification Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Defect Severity Levels

Which of the following best describes a defect with critical severity?

AA defect that causes the system to crash or lose data, blocking further testing or use.
BA defect that causes minor visual issues but does not affect functionality.
CA defect that affects performance slightly but does not stop the system from working.
DA defect that is related to spelling mistakes in the user interface.
Attempts:
2 left
💡 Hint

Think about defects that stop the system from working properly.

🧠 Conceptual
intermediate
1:30remaining
Priority vs Severity

Which statement correctly distinguishes priority from severity in defect classification?

ASeverity measures the impact on the system; priority measures how soon it should be fixed.
BPriority measures the impact on the system; severity measures how soon it should be fixed.
CSeverity and priority both measure the impact on the system equally.
DPriority and severity are the same and can be used interchangeably.
Attempts:
2 left
💡 Hint

Think about what each term controls in the defect fixing process.

❓ data_output
advanced
2:00remaining
Classify Defects by Severity and Priority

Given the following defects data, what is the count of defects with high severity and high priority?

Testing Fundamentals
import pandas as pd

defects = pd.DataFrame({
    'id': [101, 102, 103, 104, 105],
    'severity': ['high', 'medium', 'high', 'low', 'high'],
    'priority': ['high', 'low', 'high', 'medium', 'medium']
})

result = defects[(defects['severity'] == 'high') & (defects['priority'] == 'high')].shape[0]
print(result)
A0
B3
C1
D2
Attempts:
2 left
💡 Hint

Filter defects where both severity and priority are 'high'.

🔧 Debug
advanced
1:30remaining
Identify the Error in Defect Priority Assignment Code

What error will this code produce when trying to assign priority based on severity?

def assign_priority(severity):
    if severity == 'critical':
        return 'high'
    elif severity == 'major':
        return 'medium'
    else:
        return 'low'

priority = assign_priority('major')
print(priority)
ATypeError because of wrong return type
BNameError because 'priority' is not defined
CSyntaxError due to missing colon after elif statement
DNo error, prints 'medium'
Attempts:
2 left
💡 Hint

Check the syntax of the if-elif statements carefully.

🚀 Application
expert
2:00remaining
Determine Final Defect Fix Order

You have this list of defects with severity and priority. Which defect should be fixed first based on highest priority and then highest severity?

defects = [
    {'id': 1, 'severity': 'medium', 'priority': 'high'},
    {'id': 2, 'severity': 'critical', 'priority': 'medium'},
    {'id': 3, 'severity': 'high', 'priority': 'high'},
    {'id': 4, 'severity': 'low', 'priority': 'low'}
]
ADefect with id 2
BDefect with id 3
CDefect with id 1
DDefect with id 4
Attempts:
2 left
💡 Hint

First sort by priority, then by severity to decide fix order.

Practice

(1/5)
1.

What does severity indicate in defect classification?

easy
A. How serious or harmful the defect is
B. How soon the defect should be fixed
C. Who reported the defect
D. The number of times the defect occurred

Solution

  1. Step 1: Understand the meaning of severity

    Severity measures the impact or seriousness of a defect on the system or user.
  2. Step 2: Differentiate severity from priority

    Priority is about scheduling the fix, not the defect's impact.
  3. Final Answer:

    How serious or harmful the defect is -> Option A
  4. Quick Check:

    Severity = seriousness [OK]
Hint: Severity = impact level, not fix timing [OK]
Common Mistakes:
  • Confusing severity with priority
  • Thinking severity means who found the bug
  • Assuming severity counts defect occurrences
2.

Which of the following is the correct way to classify a defect with high severity and low priority?

easy
A. A defect that is not serious and can be ignored
B. A defect that causes major system failure but can be fixed later
C. A minor UI glitch that must be fixed immediately
D. A defect that is serious and must be fixed immediately

Solution

  1. Step 1: Understand high severity

    High severity means the defect causes major problems or failures.
  2. Step 2: Understand low priority

    Low priority means the defect fix can be delayed or scheduled later.
  3. Final Answer:

    A defect that causes major system failure but can be fixed later -> Option B
  4. Quick Check:

    High severity + low priority = serious but delayed fix [OK]
Hint: High severity ≠ immediate fix if priority is low [OK]
Common Mistakes:
  • Assuming high severity always means high priority
  • Mixing up severity and priority meanings
  • Ignoring the priority when severity is high
3.

Consider this defect list with severity and priority:
defects = [{'id':1, 'severity':'High', 'priority':'Low'}, {'id':2, 'severity':'Low', 'priority':'High'}, {'id':3, 'severity':'Medium', 'priority':'Medium'}]
Which defect should be fixed first based on priority?

medium
A. Defect with id 2
B. Defect with id 1
C. Defect with id 3
D. All defects have same priority

Solution

  1. Step 1: Check priority values of each defect

    Defect 1 has priority Low, Defect 2 has priority High, Defect 3 has priority Medium.
  2. Step 2: Determine which priority is highest

    High priority means fix first, so Defect 2 should be fixed first.
  3. Final Answer:

    Defect with id 2 -> Option A
  4. Quick Check:

    Highest priority = fix first [OK]
Hint: Fix defects with highest priority first [OK]
Common Mistakes:
  • Choosing based on severity instead of priority
  • Assuming Medium priority is higher than High
  • Ignoring priority values
4.

Find the error in this defect classification code snippet:

def classify_defect(severity, priority):
    if severity == 'High' and priority == 'High'
        return 'Fix Immediately'
    else:
        return 'Schedule Fix'

medium
A. Function missing return statement
B. Wrong comparison operator used
C. Missing colon after if condition
D. Indentation error in else block

Solution

  1. Step 1: Check syntax of if statement

    The if statement lacks a colon at the end of the condition line.
  2. Step 2: Verify other parts of the function

    Return statements and else block indentation are correct.
  3. Final Answer:

    Missing colon after if condition -> Option C
  4. Quick Check:

    if condition must end with ':' [OK]
Hint: Check colons after if/else statements [OK]
Common Mistakes:
  • Forgetting colon after if condition
  • Misplacing indentation in else block
  • Assuming missing return statement
5.

You have a list of defects with severity and priority:
defects = [{'id':101, 'severity':'Medium', 'priority':'High'}, {'id':102, 'severity':'High', 'priority':'Low'}, {'id':103, 'severity':'Low', 'priority':'Medium'}]
Write a Python expression using dictionary comprehension to create a dictionary mapping defect id to 'Fix Immediately' if priority is High, else 'Fix Later'.

hard
A. {d['id']: ('Fix Immediately' if d['priority'] == 'High') else 'Fix Later' for d in defects}
B. {d['id']: 'Fix Immediately' if d['priority'] == 'High' for d in defects}
C. {d['id']: 'Fix Immediately' if d['priority'] = 'High' else 'Fix Later' for d in defects}
D. {d['id']: ('Fix Immediately' if d['priority'] == 'High' else 'Fix Later') for d in defects}

Solution

  1. Step 1: Understand dictionary comprehension syntax

    It uses {key: value for item in iterable} with conditional expressions inside value.
  2. Step 2: Check conditional expression correctness

    {d['id']: ('Fix Immediately' if d['priority'] == 'High' else 'Fix Later') for d in defects} correctly uses parentheses and '==' for comparison inside the expression.
  3. Final Answer:

    {d['id']: ('Fix Immediately' if d['priority'] == 'High' else 'Fix Later') for d in defects} -> Option D
  4. Quick Check:

    Correct dict comprehension with conditional [OK]
Hint: Use parentheses around if-else in dict comprehension [OK]
Common Mistakes:
  • Using single '=' instead of '==' in condition
  • Missing parentheses around conditional expression
  • Placing else outside parentheses
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