Prerequisite Diagnostic
Allow 30–45 minutes without opening feedback first. This tests earlier skills, not knowledge of the new refactoring catalogue.
- A list is changed, then an exception is raised. Does catching it undo the change?
- What does a second traversal of an exhausted generator yield?
- A tuple contains a mutable dictionary. Can the observed dictionary contents change?
- An account rejects a withdrawal. Which return and state observations should a test inspect?
- Why is one passing example different from a universal preservation argument?
Feedback and repair
- No automatic rollback occurs. Trace mutation and exception handling separately.
- No remaining elements; distinguish reusable collections from one-shot iterators.
- Yes, through a retained mutable alias. An outer tuple is not a deep snapshot.
- Check the rejection result, balance, history and retained observations under the contract.
- Tests cover chosen cases; general reasoning needs assumptions and a valid transformation argument.
Repair tracing/functions through Semester 0 and contracts/ownership through Module 1. Python 3.10+ and the standard library are sufficient for the core labs. JavaScript and Java lesson fragments are illustrative; optional JavaScript probes need Node.js.