Specialty Digest

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

Online Courses / University Track / Python from Zero

Module 8 · Wrap-up

Discussion prompt, recap and references

Reflect on one question, review the module and find the named sources.

  • 25 minutes
  • Recap
  • References

Real-world case: Moving five million customers at once

April 2018 · A UK bank moves to a new core banking platform

In April 2018 a UK retail bank moved the records of about five million customers from the systems of its former owner to a new core banking platform run by its new parent group. The move was done in one big step over a weekend, not in stages.

Afterwards, up to 1.9 million customers were unable to use online banking, some for several weeks, and an unusual wave of fraud attacks followed. An independent review by a law firm, published in November 2019, found that the platform was neither stable nor complete when the board approved the move, and that the testing was not sufficient. One finding was that only one of two data centres had been fully tested, to avoid interrupting cash machines.

The bank later put the cost of the failure at several hundred million pounds. The bank's chairman disputed parts of the report and said the board had not been told of shortcuts in the testing that the supplier had taken.

How the case shows what you learned in this module

Module ideaIn the case
Plan the move in stagesA move of the whole customer base in one step left no way to catch a fault on a small group first.
Test the whole system, not partLeaving one of two data centres untested meant a fault in that part was unseen.
Ask the awkward questionsThe review said the board had not asked enough of the supplier about readiness.
Report what was not testedDecision-makers can only weigh risks they have been told about.

Workplace takeaway. A useful program is not only code that runs; it is a plan, tests that cover the whole setup, a staged start and an honest account of what was not tested.

Sources: Slaughter and May, Independent Review for TSB Bank (19 November 2019), as reported by Computer Weekly, ITPro, FStech and Finextra; TSB news release (19 November 2019)

Discussion prompt

20 minutes. Describe your capstone program in 200 to 250 words, as a hand-over note for someone who has never seen it: purpose, how to run it, inputs, outputs, tests you ran, and the limits you know about.

Private: nothing you type here is sent or stored.

This course has no discussion board yet, so the prompt is a private reflection.

Recap

  • Plan from the user and need; list inputs, outputs and a worked example; split into functions.
  • Build and test one function at a time; keep working copies; rerun all tests after each change.
  • Test normal, edge and bad data; check counts; try a copy of real data and trial in stages.
  • Hand over with a note covering purpose, how to run, inputs, outputs, limits and tests.

Flashcards: 12 workplace review cards

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 12 · What makes a program useful?
NeedrealRuneasilyTrusttested
Useful

Someone needs it, can run it, and can trust it. A stock report that the shop owner uses every week is useful; clever code nobody can run is not.

Card 2 of 12 · What should a plan contain?
NeeduserDatain and outStepsfunctions
The plan

The user and need, the inputs, the outputs, a worked example and a list of functions. Written on paper before any code.

Card 3 of 12 · Why work an example by hand first?
SmallinputBy handanswerBecomesfirst test
Worked example

It gives you a known answer to test against, and it often shows a missing rule, such as what happens at exactly the reorder level.

Card 4 of 12 · How do you split a task into functions?
One jobeachClearnameTestalone
Functions

One job each, with a clear name: load the rows, decide for one row, make the report. Each can be tested alone.

Card 5 of 12 · Why build one function at a time?
WriteoneTestitThenjoin
Small steps

A fault is found where it was made. If you write everything and then test, you will not know which part is wrong.

Card 6 of 12 · What does a main function do?
Callsin orderReadslike the planShortand clear
main

It calls the other functions in order and reads like your plan: load the rows, make the report, print it.

Card 7 of 12 · Why keep a working copy?
Saveafter a passBreaka changeReturnand retry
Working copy

If a change breaks the program, you can return to the last version that passed its tests and try again in a smaller step.

Card 8 of 12 · What goes in a test plan?
NormaltypicalEdgeboundaryBadinput
Test plan

Normal cases, edge cases such as exactly the reorder level, bad input such as a blank line or missing file, and a count check, each with a hand-worked answer.

Card 9 of 12 · How do you check that no rows went missing?
Read12Used9, skipped 2Gap1 missing
Count check

Rows read must equal rows used plus rows skipped. If they do not, some rows have vanished and the report cannot be trusted.

Card 10 of 12 · 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 11 of 12 · 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 12 of 12 · 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.

Module notes

Key terms. Capstone: the program you plan, build, test and explain. Test plan: a list of cases with answers worked out by hand. Count check: rows read equal rows used plus skipped. Working copy: a saved version that passed its tests. Hand-over note: the explanation for the next user. Limit: something the program cannot do or was not tested for. Staged use: widening use only when the last stage is safe.

Rules and formulas. rows read = rows used + rows skipped; expected answer by hand first; one function, one job; one change at a time.

Limits of this module. This module plans programs of a few functions with small data files. Larger systems also need version control, review by others, security checks and maintenance plans. Real systems are built by teams and tested in more ways than shown here.

Next

You have reached the end of the course. Return to the course overview or the University Track.

References and further reading