Activity 01
Pair Testing: Unit Test Challenges
Pairs select functions from their capstone code and write 5-10 unit tests, including edge cases like null inputs. They run tests using frameworks like JUnit or pytest, then swap code with another pair for verification. Discuss failures and refactor as needed.
How do we prove that our code works as intended under edge-case conditions?
Facilitation TipDuring Pair Testing, assign roles explicitly so one student writes tests while the other implements the function, forcing both to think critically about the other’s work.
What to look forProvide students with a small, incomplete code snippet (e.g., a function with a logical error). Ask them to write one unit test case that would fail due to the error and explain why it fails. Collect and review for understanding of test case creation.