Test Overview
This test simulates how testing is integrated into Scrum sprints. It verifies that test cases are created, executed, and defects are logged within the sprint cycle.
This test simulates how testing is integrated into Scrum sprints. It verifies that test cases are created, executed, and defects are logged within the sprint cycle.
class ScrumSprintTest: def __init__(self): self.test_cases = [] self.defects_logged = [] def add_test_case(self, test_case): self.test_cases.append(test_case) def execute_tests(self): for test in self.test_cases: if not test(): self.defects_logged.append(f"Defect in {test.__name__}") def sprint_complete(self): return len(self.defects_logged) == 0 # Example test cases def test_login(): # Simulate a passed test return True def test_payment(): # Simulate a failed test return False # Test execution sprint_test = ScrumSprintTest() sprint_test.add_test_case(test_login) sprint_test.add_test_case(test_payment) sprint_test.execute_tests() assert sprint_test.sprint_complete() == False, "Sprint should not complete due to defects"
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Create ScrumSprintTest instance | Empty test cases and defects lists | - | PASS |
| 2 | Add test_login to test cases | test_cases contains test_login | - | PASS |
| 3 | Add test_payment to test cases | test_cases contains test_login and test_payment | - | PASS |
| 4 | Execute test_login | test_login returns True (pass) | No defect logged for test_login | PASS |
| 5 | Execute test_payment | test_payment returns False (fail) | Defect logged for test_payment | PASS |
| 6 | Check if sprint is complete | defects_logged contains one defect | Sprint complete returns False | PASS |