Skip to main content

Design and Diagnosis Clinic

Complete the original tracker first. This clinic adds 8–12 focused hours: design lesson and practice 2–3; debugging lesson and investigation 2–3; independent task and explanation 3–4; review and one bounded repair 1–2. Existing tracker work is not repeated. These are estimates awaiting a learner pilot.

Guided practice​

Read systematic design and debugging experiments. Trace the worked program by hand, then run it in a temporary Python file. Complete the earliest-index drill. Compare your observations with your predictions; record discrepancies rather than editing the predictions afterward.

Independent design task​

From a blank file, implement first_over_budget(costs, budget) for a sequence of nonnegative whole-number costs and a nonnegative whole-number budget. Inputs are already validated Python integers; booleans and malformed external input are outside this pure function's domain. Return the zero-based index of the first cost that makes the running total strictly exceed the budget; return None if this never happens. Preserve the list and its order. Zero costs and repeated values are valid. An empty sequence never exceeds the budget.

Before implementation, submit a data/contract note and independently computed examples covering empty input, zero budget, equality, first-entry overflow, final-entry overflow and duplicates. Explain the running state and why early return is valid. Use Python documentation, but no generated implementation or calibration answer. Record hints and assistance. This function has no file I/O: the original tracker assessment still checks persistence and rejection behavior.

Then change the requirement: report how much budget remains before the first rejected cost as well as its index. Define the no-rejection result explicitly before changing code. Explain which parts of the implementation and tests need to change. Alternate coherent output conventions are acceptable when documented and consistently tested.

Independent diagnosis task​

This seeded candidate violates the original first_over_budget contract:

def candidate(costs, budget):
total = 0
for index, cost in enumerate(costs):
total += cost
if total >= budget:
return index
return None

Start with the report candidate([4,6], 10) returns 1, expected None. Write two plausible explanations, an experiment with predicted outcomes, your observation, the mechanism you found, and a minimal repair. Retain tests that distinguish equality from strict excess and check a first-entry excess. A checker cannot grade your reasoning: explain it to a reviewer or label it self-assessed.

Evidence and feedback​

Keep one compact folder: design note, your implementation, tests, investigation note, changed-requirement explanation and actual study times. Do not build a second application or portfolio. Append this evidence to the original tracker packet.

Use the rubric and open the calibration only after preserving your attempt. A failed category requires a fresh variant; memorizing the calibration does not close it. Follow the pilot and retention record for later checks.