Activity 01
Pair Programming: Test a Shape Class
Pairs receive a Circle class with radius and area methods. Write at least six tests: valid radii, zero, negative, large values, and exceptions. Run tests iteratively, fix failures, then swap pairs to review and add one more test each.
Explain the importance of unit testing in the software development lifecycle.
Facilitation TipDuring Pair Programming: Test a Shape Class, circulate to ensure pairs alternate roles every 10 minutes so both students engage deeply with both production and test code.
What to look forProvide students with a simple Python class (e.g., a 'BankAccount' class with deposit and withdraw methods). Ask them to write two unit tests: one for a successful withdrawal and one for an attempted withdrawal exceeding the balance. Review their test code for correct syntax and assertion usage.