0
0
Testing Fundamentalstesting~15 mins

Entry and exit criteria in Testing Fundamentals - Build an Automation Script

Choose your learning style9 modes available
Verify entry and exit criteria for a software testing phase
Preconditions (3)
Step 1: Review the test plan to identify entry criteria for the testing phase
Step 2: Check that all entry criteria are met before starting testing
Step 3: Execute the planned test cases
Step 4: Monitor test execution and log defects if any
Step 5: Review the exit criteria defined in the test plan
Step 6: Verify that all exit criteria are met after test execution
✅ Expected Result: Testing phase starts only after all entry criteria are met and ends only when all exit criteria are fulfilled as per the test plan
Automation Requirements - Python unittest
Assertions Needed:
Assert all entry criteria are true before test execution
Assert all exit criteria are true after test execution
Best Practices:
Use setup and teardown methods to check entry and exit criteria
Use clear and descriptive assertion messages
Keep test code simple and readable
Automated Solution
Testing Fundamentals
import unittest

class TestEntryExitCriteria(unittest.TestCase):
    def setUp(self):
        # Simulate checking entry criteria
        self.requirements_approved = True
        self.test_plan_available = True
        self.test_environment_ready = True

        # Assert entry criteria
        self.assertTrue(self.requirements_approved, "Requirements must be approved before testing")
        self.assertTrue(self.test_plan_available, "Test plan must be available before testing")
        self.assertTrue(self.test_environment_ready, "Test environment must be ready before testing")

    def test_execute_tests(self):
        # Simulate test execution
        self.tests_executed = True
        self.defects_logged = False  # Assume no defects found
        self.all_tests_passed = True

        # Assertions during test execution
        self.assertTrue(self.tests_executed, "Tests should be executed")

    def tearDown(self):
        # Simulate checking exit criteria
        self.all_defects_fixed = True
        self.test_coverage_complete = True

        # Assert exit criteria
        self.assertTrue(self.all_defects_fixed, "All defects must be fixed before exit")
        self.assertTrue(self.test_coverage_complete, "Test coverage must be complete before exit")

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

The setUp method checks the entry criteria before any test runs. It asserts that requirements are approved, the test plan is available, and the test environment is ready.

The test_execute_tests method simulates running tests and asserts that tests have been executed.

The tearDown method checks exit criteria after tests finish. It asserts that all defects are fixed and test coverage is complete.

This structure ensures the test phase only starts and ends when the correct criteria are met, following best practices for clear assertions and setup/teardown usage.

Common Mistakes - 3 Pitfalls
Not verifying entry criteria before starting tests
Skipping exit criteria checks after tests
Hardcoding criteria checks without clear assertions
Bonus Challenge

Now add data-driven testing to verify entry and exit criteria with different scenarios (e.g., missing requirements approval, incomplete test coverage)

Show Hint