AAmit’s LibraryLEARN · PRACTISE · REFLECT

Learning and retention × Programming

Business lens: Learning and retention · Technology lens: Programming

Reading scope: Original synthetic teaching. Primary links support selected background, not invented business outcomes or implemented organisational systems.

Passing code is not the same as explaining code

A learner runs a program and sees every supplied test pass. Programming education also asks whether the learner can predict behaviour, explain assumptions and adapt the code to a new problem. Begin with a small function and a question that requires a trace before execution. Computers can provide repeatable output and immediate checks; people select examples, examine errors and connect operations to concepts. The useful learning route is prediction, execution, explanation and correction rather than repeated copying until a green result appears. A passing test is evidence about a defined program behaviour, not direct evidence that the person understands all the ideas used by the program.

Define behavioural and explanation rubrics separately

The worksheet distinguishes a supplied test case from an explanation question. A test contains input and expected output under a stated contract. An explanation asks why that result occurs and what would change under a counterexample. Test documentation supports the first activity, while retrieval background supports attempting an answer before consulting it. Neither verifies the learner's understanding. Preserve the response before execution or feedback so the review can locate the misconception. If an environment or dependency causes an error, distinguish it from a conceptual mistake. A useful practice task should show which evidence concerns the code and which concerns the learner's reasoning.

Calculate two different success rates

The invented function passes all eight supplied behavioural tests, giving 8/8 = 100% supplied-suite pass rate. A separate five-question explanation task has three rubric-correct answers, giving 3/5 = 60% explanation correctness rate. The two incorrect explanations should not be marked correct because the program passed its tests. In a stipulated later explanation attempt, four answers meet the same rubric, giving 4/5 = 80%, a twenty-percentage-point increase. These designed observations do not establish general program correctness, independent authorship or permanent retention. The test suite may omit relevant cases, and the later answer conditions need to be disclosed before inferring a cause for the change.

Use feedback to identify the next concept

The learner records a prediction and trace. The teacher or content owner supplies the contract and rubric. A reviewer identifies whether an error concerns control flow, data representation or an unstated assumption. The technical environment supports execution but cannot decide every explanation's meaning automatically. Consultation should clarify ambiguous task wording rather than reward a memorised phrase detached from reasoning. The handoff should point to a specific concept and a new counterexample. In workplace training, management should distinguish completed exercise activity from demonstrated capability on the actual job. A useful record connects the error to the next learning action without turning one small score into a judgement of the person's overall ability.

Practice prediction and counterexamples

Use the cleaning lesson to select a short transformation and predict its output before running it. Write an explanation for an identifier with leading zeros, a missing value and a numeric-looking string whose meaning depends on context. Keep the eight behavioural tests separate from the five explanation questions. After feedback, revisit one incorrect explanation with a changed input. This extension is a learning worksheet, not a new executed programming curriculum or an independently evaluated teaching intervention. The synthetic arithmetic reproduces the two success rates only. The lesson teaches how to use computer feedback as one part of conceptual learning instead of treating executable success as sufficient evidence of understanding.

Levels and reasoning questions

Who defines expected behaviour? Whom does misunderstood code affect? Whose explanation is reviewed? What assumption drives the result? Where is the pre-execution prediction retained? When is feedback available? Why are test and explanation denominators different? Which counterexample is omitted? How is transfer checked? Foundation study distinguishes running and understanding. Undergraduate study computes the three rates and traces behaviour. Postgraduate study critiques suite limits, task validity and feedback conditions. Research study proposes a bounded programming-learning investigation with explicit evidence. The portfolio should connect code execution to explanation, correction and application while retaining the limits of a supplied test suite and a small set of classroom questions.

Study questions and answers

Compute the supplied-test pass rate and explanation correctness rate.

100% of eight supplied tests pass; three of five explanations are rubric-correct, or 60%.

Marking guide: Credit all eight supplied tests passing = 100%, explanation correctness 3/5 = 60%.

What is the later explanation rate and change?

4/5 = 80%, twenty percentage points above 60%.

Marking guide: Credit later 4/5 = 80% and twenty percentage-point rise.

Does passing the suite prove understanding or general correctness?

No. Both require evidence beyond the supplied behavioural tests.

Marking guide: Behavioural suite success proves neither understanding nor general correctness; identify required evidence beyond supplied tests.

Practice task

Create a prediction/trace worksheet with separate behavioural tests, explanation rubrics and changed-input review.

Practice bridge

  1. Extend the cleaning lesson with pre-execution predictions and explanation questions.
  2. Inspect leading-zero and missing-context counterexamples; separate code output from learner reasoning.

Open connected lab

Boundary: No new learning intervention or general program-correctness proof is supplied; the example is a bounded explanation worksheet.

Sources and further reading

  • Python — unittest
    Scope: Selected test cases, assertions and fixtures; passing examples do not prove complete coverage.
    Access: Public reading retrieved without an account; service entitlements and hosted execution not checked.
  • MIT Open Learning — Retrieval practice
    Scope: Selected institutional explanation of retrieval and feedback, not validation of this library, a guaranteed individual outcome or a full review of cited research.
    Access: Selected public reading without an account; certificates, paid service entitlements and hosted execution not checked.

Related chapters

Interactive practice

Open workshop · Open runnable practice · Open lab lab-16

Open interactive matrix reading