Activity 01
Pair Programming: TDD for String Validator
Pairs write failing tests for functions validating email formats or palindromes. They implement code to pass tests, then refactor for efficiency. Pairs swap code with neighbors to run tests and provide feedback.
Justify the practice of writing tests before implementing features.
Facilitation TipDuring Pair Programming, circulate and coach pairs to verbalize their thought process when deciding what to test next, ensuring they stay in the TDD cycle rather than reverting to traditional coding.
What to look forPresent students with a simple Python function (e.g., `add(a, b)`). Ask them to write one unit test for this function using a testing framework like `unittest` or `pytest`. Observe if the test correctly asserts the expected output for given inputs.