Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

5.4 (5 of 8): Testing, rolling out and going back

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

45 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

Payday disaster

A firm replaces its old payroll system with a new one. On the day, the old system is switched off and the new one is switched on.

On payday, 300 workers are paid the wrong amount. The old system is gone. There is no copy. It takes two weeks to fix.

What should the firm have done? It should have tested properly, chosen a safer way to switch and planned a way back.

Key words

WordWhat it meansExample
Test environmentA safe copy of the system, used only for tests, never the real (live) system.A computer used only for tests
ReproducibleGiving the same result each time it runs the same way.The same test, the same answer
Parallel runningRunning the old and new systems together for a time.Both pay the staff, and we compare
Phased roll-outBringing in the new system one part at a time.One department a month
Direct change-overSwitching from the old system to the new one at once.At midnight on Sunday
PilotTrying the new system with a small group first.One office of 10 people
RollbackGoing back to the old, working version.Restore last night's backup
BackupA copy of data, kept in case of a problem.A nightly copy
Legacy systemAn older system that the organisation still uses.An old stock program

The cells students fill in are left blank in this preview.

Quick check: payday disaster

Have a go

Quick check: payday disaster

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Set the new system up to fit

Before anybody uses it, set up (configure) the new system to fit the organisation. Two points matter most.

Working with the legacy systems. The new system must share data with the old ones that stay.

Keeping the service running. Customers and staff must still be able to work during the change.

Test fully, in a safe place

Test the new system before anybody depends on it. Use a test environment: a copy of the live system (the real system people use). It has the same kind of hardware and software. Mistakes do no harm there.

Tests must be reproducible. If you run the same test twice in the same way, you get the same result. Then you can trust it, and you can find and fix problems.

Test in the right place

WhereGood or bad?Why
The live systemBadA mistake affects real customers
A test environment that matches liveGoodSafe, and results are close to real
A test environment with different softwarePoorA pass may not mean a pass in live
Tests written down and repeatableGoodAnybody can run them again and get the same answer

The cells students fill in are left blank in this preview.

Quick check: testing

Have a go

Quick check: testing

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Four ways to switch

Parallel: run both systems together for a time. Compare the results. Safe, but it is double the work.

Phased: move one part at a time. Learn as you go. It takes longer.

Direct: switch off the old and switch on the new at once. Fast and cheap. Very risky.

Pilot: try with a small group first. Fix problems before everyone uses it.

The four methods compared

MethodGood pointsBad pointsBest when
ParallelVery safe. Results can be comparedDouble work. Costs moreA mistake would cost a lot, such as with pay or banking
PhasedProblems are found early. Users get used to it slowlyTakes longer. Old and new live side by sideA big system with many parts
DirectQuick and cheapVery risky. Hard to go backA small, simple change, or a date that cannot move
PilotReal test with few usersPilot users may not be like all the other usersA new system for a big group of people

The cells students fill in are left blank in this preview.

Pick the best method

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Phased roll-out: one department at a time

A flowchart: "Start" leads to "Sales uses the new system", then to the question "Is it working well?"; "yes" leads to "Finance uses it next", then to "Then HR, then everyone"; "no" leads to "Fix problems first", which leads back to "Sales uses the new system".A flowchart: "Start" leads to "Sales uses the new system", then to the question "Is it working well?"; "yes" leads to "Finance uses it next", then to "Then HR, then everyone"; "no" leads to "Fix problems first", which leads back to "Sales uses the new system".

Your turn: compare and go back

This task is about running the old and new systems in parallel. The first function finds the places where the old and the new results are different. The second says if the new system is ready to switch on: only a few differences are allowed. The third is a rollback helper: it finds the newest backup made on or before a day. If there is none, give back None. Press Run Tests to check your work.

Code: python
def differences(old_results, new_results):
    # Both are lists of the same length. Give back the positions (starting at 0)
    # where the old and new results are different.
    return None


def ready_to_switch(old_results, new_results, allowed):
    # True if the number of differences is the allowed number or fewer.
    return None


def latest_backup(backups, before_day):
    # backups is a list of [day, name] pairs. Give back the name of the newest backup
    # made on or before before_day. Give back None if there is none.
    return ""

Make a free account to save your work, or press Start lab to work through the whole lesson.

A rollback plan is your way back

Even with good testing, a change can fail. A rollback plan says how to go back to the old, working version.

It needs three parts.

Backup method: how and when copies are made, for example every night.

Backup location: where the copies are kept, in a different place from the original.

Recovery plan: the steps, the people and the time needed to restore.

A rollback plan, in three parts

PartQuestions to askExample answer
Backup methodWhat is copied? How often? Who checks?The full payroll data is copied every night and checked each Monday
Backup locationWhere are the copies? Are they safe if the building floods?One copy in the cloud and one at another office
Recovery planWho does what? How long will it take? Have we practised?The IT lead restores in two hours. We practise twice a year

The cells students fill in are left blank in this preview.

Scenario: the failed update

Have a go

Scenario: the failed update

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Key words crossword

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Watch: testing, rolling out and going back

Press Play on the short film below. It starts with the payday disaster. Then it goes through where to test, the four ways to switch and the three parts of a rollback plan. Listen for the myth.

Film: testing, rolling out and going back

Testing, rolling out and going back

Every scene, as text

  1. Payday disaster. The old system is switched off and the new one is switched on. On payday, 300 workers are paid the wrong amount (problem: the old system is gone, no copy). Test properly, choose a safer way to switch, plan a way back (the fix: what the firm should have done).
  2. Test fully, in a safe place. The live system (bad: a mistake affects real customers). A test environment that matches live (good: safe, and results are close to real). Tests written down and repeatable (good: the same test, the same answer).
  3. Four ways to switch: parallel and phased. Parallel: run both systems together for a time (good: very safe; best when: a mistake would cost a lot). Phased: move one part at a time (best when: a big system with many parts).
  4. Four ways to switch: direct and pilot. Direct: switch from the old system to the new one at once (bad: very risky. Hard to go back; best when: a small, simple change). Pilot: try with a small group first (best when: a new system for a big group).
  5. Myth (false): a phased roll-out and a pilot are the same. That is not true. Phased: everyone gets it, a stage at a time (example: Sales, then Finance, then HR). Pilot: a small group tries it and then a decision is made (example: one office of 10 people).
  6. A rollback plan is your way back. Backup method (what it is: how and when copies are made). Backup location (what it is: where the copies are kept). Recovery plan (what it is: the steps, people and time).

Final check

Have a go

Final check

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.