Test Overview
This test simulates how different testing levels (unit, integration, system) catch different types of bugs. It verifies that bugs found at each level match the expected bug type.
This test simulates how different testing levels (unit, integration, system) catch different types of bugs. It verifies that bugs found at each level match the expected bug type.
import unittest class BugDetectionTest(unittest.TestCase): def test_unit_level_bug(self): bug_found = 'logic error' self.assertEqual(bug_found, 'logic error') def test_integration_level_bug(self): bug_found = 'interface mismatch' self.assertEqual(bug_found, 'interface mismatch') def test_system_level_bug(self): bug_found = 'performance issue' self.assertEqual(bug_found, 'performance issue') if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and runs test_unit_level_bug | Unit test simulates finding a logic error in code | Check bug_found equals 'logic error' | PASS |
| 2 | Runs test_integration_level_bug | Integration test simulates finding interface mismatch between modules | Check bug_found equals 'interface mismatch' | PASS |
| 3 | Runs test_system_level_bug | System test simulates finding performance issue in full system | Check bug_found equals 'performance issue' | PASS |
| 4 | All tests complete | All bug types correctly detected at their testing levels | - | PASS |