Bird
Raised Fist0
Testing Fundamentalstesting~15 mins

Bug severity vs priority in Testing Fundamentals - Automation Approaches Compared

Choose your learning style10 modes available
Verify correct classification of bug severity and priority
Preconditions (2)
Step 1: Open the bug tracking system
Step 2: Select a bug with 'Critical' severity
Step 3: Verify that the bug's priority is set to 'High'
Step 4: Select a bug with 'Minor' severity
Step 5: Verify that the bug's priority is set to 'Low'
Step 6: Select a bug with 'Major' severity
Step 7: Verify that the bug's priority is set to 'Medium'
Step 8: Change the priority of a 'Critical' severity bug to 'Low'
Step 9: Verify that a warning message appears indicating mismatch between severity and priority
✅ Expected Result: Bugs with 'Critical' severity have 'High' priority, 'Major' severity have 'Medium' priority, 'Minor' severity have 'Low' priority. Changing priority to a level inconsistent with severity triggers a warning.
Automation Requirements - Selenium with Python
Assertions Needed:
Verify bug severity label text matches expected
Verify bug priority label text matches expected
Verify warning message appears when priority and severity mismatch
Best Practices:
Use explicit waits for elements to be visible
Use Page Object Model to separate page interactions
Use clear and descriptive assertion messages
Automated Solution
Testing Fundamentals
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import unittest

class BugPage:
    def __init__(self, driver):
        self.driver = driver

    def open_bug(self, bug_id):
        self.driver.get(f"https://bugtracker.example.com/bugs/{bug_id}")

    def get_severity(self):
        return WebDriverWait(self.driver, 10).until(
            EC.visibility_of_element_located((By.ID, "bug-severity"))
        ).text

    def get_priority(self):
        return WebDriverWait(self.driver, 10).until(
            EC.visibility_of_element_located((By.ID, "bug-priority"))
        ).text

    def set_priority(self, priority):
        priority_dropdown = WebDriverWait(self.driver, 10).until(
            EC.element_to_be_clickable((By.ID, "priority-dropdown"))
        )
        priority_dropdown.click()
        option = WebDriverWait(self.driver, 10).until(
            EC.element_to_be_clickable((By.XPATH, f"//option[text()='{priority}']"))
        )
        option.click()

    def get_warning_message(self):
        return WebDriverWait(self.driver, 5).until(
            EC.visibility_of_element_located((By.ID, "priority-warning"))
        ).text

class TestBugSeverityPriority(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.bug_page = BugPage(self.driver)

    def tearDown(self):
        self.driver.quit()

    def test_bug_severity_priority_mapping(self):
        # Test Critical severity bug
        self.bug_page.open_bug("CRIT-001")
        severity = self.bug_page.get_severity()
        priority = self.bug_page.get_priority()
        self.assertEqual(severity, "Critical", "Severity should be Critical")
        self.assertEqual(priority, "High", "Priority should be High for Critical severity")

        # Test Minor severity bug
        self.bug_page.open_bug("MIN-002")
        severity = self.bug_page.get_severity()
        priority = self.bug_page.get_priority()
        self.assertEqual(severity, "Minor", "Severity should be Minor")
        self.assertEqual(priority, "Low", "Priority should be Low for Minor severity")

        # Test Major severity bug
        self.bug_page.open_bug("MAJ-003")
        severity = self.bug_page.get_severity()
        priority = self.bug_page.get_priority()
        self.assertEqual(severity, "Major", "Severity should be Major")
        self.assertEqual(priority, "Medium", "Priority should be Medium for Major severity")

    def test_priority_change_warning(self):
        self.bug_page.open_bug("CRIT-001")
        self.bug_page.set_priority("Low")
        warning = self.bug_page.get_warning_message()
        self.assertIn("mismatch", warning.lower(), "Warning should appear for priority and severity mismatch")

if __name__ == "__main__":
    unittest.main()

The code uses Selenium with Python and unittest framework.

The BugPage class follows the Page Object Model to keep page actions organized.

Explicit waits ensure elements are ready before interacting.

Test methods check that bugs with different severities have correct priorities.

Another test changes priority to an inconsistent value and verifies a warning message appears.

Assertions have clear messages to help understand failures.

Common Mistakes - 3 Pitfalls
Using hardcoded sleep instead of explicit waits
Mixing locators styles inconsistently
Not verifying warning message after priority change
Bonus Challenge

Now add data-driven testing with 3 different bugs having various severity and priority combinations

Show Hint

Practice

(1/5)
1. What does bug severity describe in software testing?
easy
A. How serious or harmful the bug is to the system
B. How quickly the bug should be fixed
C. Who reported the bug
D. The number of times the bug occurred

Solution

  1. Step 1: Understand severity meaning

    Severity measures the impact or seriousness of a bug on the system's functionality or performance.
  2. Step 2: Differentiate from priority

    Priority is about the order of fixing, not the impact itself.
  3. Final Answer:

    How serious or harmful the bug is to the system -> Option A
  4. Quick Check:

    Severity = Impact [OK]
Hint: Severity = impact level, priority = fix order [OK]
Common Mistakes:
  • Confusing severity with priority
  • Thinking severity is about who reports the bug
  • Mixing severity with bug frequency
2. Which of the following correctly describes priority in bug tracking?
easy
A. The order in which the bug should be fixed
B. The severity level of the bug
C. The number of users affected by the bug
D. The type of bug found

Solution

  1. Step 1: Define priority

    Priority tells the team how soon a bug should be fixed based on business needs or deadlines.
  2. Step 2: Compare with severity

    Severity is about impact, priority is about timing and importance for fixing.
  3. Final Answer:

    The order in which the bug should be fixed -> Option A
  4. Quick Check:

    Priority = Fix order [OK]
Hint: Priority = fix order, not impact [OK]
Common Mistakes:
  • Mixing priority with severity
  • Assuming priority depends on bug type
  • Confusing priority with user count
3. A bug causes the application to crash for all users, but the fix can wait until the next release. What is the likely severity and priority?
medium
A. High severity, high priority
B. Low severity, high priority
C. High severity, low priority
D. Low severity, low priority

Solution

  1. Step 1: Assess severity

    Application crash affects all users, so severity is high because it impacts functionality seriously.
  2. Step 2: Assess priority

    Fix can wait until next release, so priority is low because it is not urgent to fix immediately.
  3. Final Answer:

    High severity, low priority -> Option C
  4. Quick Check:

    Crash = High severity, fix delay = Low priority [OK]
Hint: Crash = high severity; fix timing = priority [OK]
Common Mistakes:
  • Assuming crash always means high priority
  • Confusing severity with priority urgency
  • Ignoring fix timing in priority
4. A tester marked a cosmetic UI bug as 'High Priority' but 'Low Severity'. What is the best correction?
medium
A. Change priority to High, keep severity High
B. Change priority to Low, keep severity Low
C. Change severity to Low, keep priority High
D. Change severity to High, keep priority High

Solution

  1. Step 1: Understand cosmetic bug impact

    Cosmetic bugs usually have low severity because they don't affect functionality.
  2. Step 2: Adjust priority based on impact

    Since cosmetic bugs are not urgent, priority should also be low to avoid wasting resources.
  3. Final Answer:

    Change priority to Low, keep severity Low -> Option B
  4. Quick Check:

    Cosmetic bug = Low severity & priority [OK]
Hint: Cosmetic bugs usually low priority and severity [OK]
Common Mistakes:
  • Setting high priority for cosmetic bugs
  • Confusing severity with priority urgency
  • Ignoring bug impact on functionality
5. A security vulnerability allows data leaks but affects only a small user group. The business wants it fixed quickly. How should severity and priority be set?
hard
A. High severity, Low priority
B. Low severity, High priority
C. Low severity, Low priority
D. High severity, High priority

Solution

  1. Step 1: Evaluate severity of security vulnerability

    Security issues causing data leaks are serious, so severity is high regardless of user count.
  2. Step 2: Consider business urgency for fix

    Business wants quick fix, so priority must be high to address the risk fast.
  3. Final Answer:

    High severity, High priority -> Option D
  4. Quick Check:

    Security risk = High severity & priority [OK]
Hint: Security bugs = always high severity and priority [OK]
Common Mistakes:
  • Lowering severity due to small user impact
  • Ignoring business urgency in priority
  • Confusing severity with priority
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