Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Flashcards: open the module flashcards (end-of-module review with workplace questions).

Online Courses / University Track / Python from Zero

Module 8 · Lesson 4 · Core

Explaining and handing over your program

Write a hand-over note, present results clearly and state the limits.

  • 50 minutes
  • Serves O6
  • Assumes M8.L3

Phase 1: Prepare

Step 1 Warm-up recall

From M8.L3: what should a count check compare?

Private: nothing you type here is sent or stored.

Step 2 Learning goal

By the end of this lesson you can:

  • write a hand-over note (Foundation);
  • state limits honestly (Core);
  • present results to a non-programmer (Core).

Phase 2: Teach

Step 3 A familiar example

A good mechanic hands back the car with a note of what was done, what to watch and what is still not fixed. A program needs the same hand-over.

Step 4 Clear explanation

A program is useful only if the next person can run it and trust it. A short hand-over note answers six questions.

Purpose0How to run1Inputs2Outputs3Limits4Tests5Say what it cannot do
A hand-over note answers six questions: what it does, how to run it, what goes in, what comes out, what it cannot do and how it was tested.
STOCK REPORT - hand-over note

Purpose: lists items at or below their reorder level.
How to run: put stock.csv beside the program, then run it.
Inputs: stock.csv with columns item,qty,reorder (whole numbers).
Outputs: a printed list of items to reorder, and the number
         of rows skipped as bad.
Limits: does not read other file types; does not update stock;
        a quantity written as text is skipped and counted.
Tests: 12 test cases passed, including quantity 0, a quantity
       equal to the level, a blank line and a missing file.
       Not tested: files over 100,000 rows.

Write for a reader who has never seen the code. Use the words of the shop or office, not of programming. Say what the program cannot do and what you assumed, because a hidden assumption, such as a unit or a column order, is how mismatches arise.

When you present results, give the answer first, then how sure you are, then what was left out. A number with no count, no unit and no source is not yet a result.

Step 5 Worked example (4 marks)

Which of these belongs in the Limits line of a note: (a) "written in Python", (b) "skips rows where qty is text and reports them", (c) "fast"?

  1. (a) says nothing the user can act on. (1 mark)
  2. (c) is a claim with no evidence. (1 mark)
  3. (b) is a real, testable limit and says what happens. (1 mark)
  4. Answer: (b). (1 mark)

Go deeper: the professor's notes

Tell the next person what the program does, what it needs and what it cannot do.
Purpose

What for.

Limits

Cannot do.

Tests

Run.

PurposewhyRunhowLimitscannotTestsdone
Explain

Note

SectionContent
limitswhat it cannot do
testswhat passed, what was not tested

At work: A hand-over

Someone else will run your program.

  1. Write the six parts.
  2. Ask them to run it from the note.

What a careful practitioner decides. A hand-over note is part of the program.

Phase 3: Practise

Step 6 Learner practice (instant-marked)

1. A hand-over note is written for:

2. The Limits section should say:

3. A result presented to a user needs:

4. A hidden assumption such as a unit should be:

Phase 4: Close

Step 7 Recap

  • The note covers purpose, how to run, inputs, outputs, limits and tests.
  • Write for someone who has not seen the code.
  • State assumptions and what was not tested.

Step 8 Exit ticket (ungraded)

Write the Purpose, Inputs and Limits lines for your own program.

Private: nothing you type here is sent or stored.

Step 9 Go further (Extension)

Give your note to a classmate and ask them to run the program from it alone.

In industry: Southwest Airlines: a system overwhelmed

In December 2022 the automated system used to reassign pilots and flight attendants after disruptions was overwhelmed by the scale of the task during and after a winter storm. Staff had to work through records by hand, and the airline cancelled thousands of flights.

Link to this lesson. Test how a program behaves when the data is far larger and messier than normal, and plan a manual fallback.

Source: Wall Street Journal via the AI Incident Database; Dallas Morning News, 29 December 2022

Common mistakes

MistakeWhy it fails
Writing the note for programmersUse the user's words.
Leaving out limitsState what it cannot do.
Giving a number with no count or unitAdd count, unit and source.

Limits. Larger programs also need maintenance plans and training, which are beyond this course.

Flashcards for this lesson (3)

Tap a card to reveal the answer. Read the question, answer it aloud or in writing first, then check yourself against the explanation.

Card 1 of 3 · Why try real data as a copy first?
OriginalsafeCopytestedTriallimited
Copy first

A fault could damage the original. A copy lets you find problems safely, and a limited trial keeps any remaining fault from reaching many people.

Card 2 of 3 · What goes in a hand-over note?
PurposewhyRunhowLimitscannot
Hand-over

Purpose, how to run, inputs, outputs, limits and tests. Write in the words of the user for someone who has never seen the code.

Card 3 of 3 · Why state limits and what was not tested?
Statethe limitSaynot testedProtectsthe user
Limits

People can only weigh risks they know about. An honest limit, such as files over 100,000 rows not tested, protects the next user and you.

Review with flashcards

Test yourself on this module with workplace flashcards and detailed answers.

Open the module flashcards