0
0
Testing Fundamentalstesting~10 mins

Bug severity vs priority in Testing Fundamentals - Test Execution Compared

Choose your learning style9 modes available
Test Overview

This test checks if a bug tracking system correctly assigns and displays bug severity and priority levels. It verifies that severity and priority labels appear as expected when a bug is created.

Test Code - unittest
Testing Fundamentals
import unittest
from bug_tracker import Bug, BugTracker

class TestBugSeverityPriority(unittest.TestCase):
    def setUp(self):
        self.tracker = BugTracker()

    def test_bug_severity_and_priority_display(self):
        # Create a bug with severity 'Critical' and priority 'High'
        bug = Bug(title='App crash on login', severity='Critical', priority='High')
        self.tracker.add_bug(bug)

        # Retrieve the bug from tracker
        retrieved_bug = self.tracker.get_bug_by_title('App crash on login')

        # Assert severity is 'Critical'
        self.assertEqual(retrieved_bug.severity, 'Critical')

        # Assert priority is 'High'
        self.assertEqual(retrieved_bug.priority, 'High')

if __name__ == '__main__':
    unittest.main()
Execution Trace - 7 Steps
StepActionSystem StateAssertionResult
1Test startsTest framework initialized, no bugs in tracker-PASS
2Create a bug with severity 'Critical' and priority 'High'Bug object created with given severity and priority-PASS
3Add the bug to the bug trackerBug tracker contains one bug with title 'App crash on login'-PASS
4Retrieve the bug by title from the trackerBug object retrieved with severity 'Critical' and priority 'High'-PASS
5Assert the bug severity is 'Critical'Bug severity is 'Critical'Check if retrieved_bug.severity == 'Critical'PASS
6Assert the bug priority is 'High'Bug priority is 'High'Check if retrieved_bug.priority == 'High'PASS
7Test ends successfullyBug severity and priority verified correctly-PASS
Failure Scenario
Failing Condition: Bug severity or priority is not set or retrieved correctly
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify about the bug?
AThat the bug's description is displayed
BThat the bug's severity and priority labels are correctly assigned and retrieved
CThat the bug is automatically fixed
DThat the bug is deleted after creation
Key Result
Always verify that bug tracking systems correctly handle both severity and priority fields, as they guide developers on impact and fix order.