AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Safe, correct and checked

Week 24 · 3.2 Data transmission and security · 3 lessons
3

Project: results sender

Computing 8: Topic 3.2, pp. 244–254
GoalPlan, make, test and evaluate a plan that keeps a club’s match results safe and error-free.
New words
test plan · a table of tests with the expected outcome worked out before the testevaluate · judge how well your solution works and say how to improve ittrusted sender · a device the owner has chosen to allow through the firewall
Explanation

Here is an invented problem. A village football club has a tablet at the pitch and a club computer in the office. The tablet sends the final score to the computer over wi-fi each Saturday. The club worries about two things: scores that arrive with errors, and unknown devices trying to send data. Your job is to plan and test a solution on paper. Step 1: plan, by writing down the risks and one method for each. Step 2: make, by writing the echo-check steps and the firewall rule. Step 3: test, by writing a test plan and working out the expected outcomes first. Step 4: evaluate, by saying what works, what does not and what you would improve.

RiskMethodHow it helps
a score arrives with an errorecho checkthe sender compares the copy and sends again
an unknown device sends datafirewall ruleonly trusted senders are let in
a virus in a downloaded fileantivirusscan files and quarantine suspects
Worked examples
Python
1address = input("Address? ")
2if address == "192.0.2.10" or address == "192.0.2.20":
3    print("Let in")
4else:
5    print("Block")
Output
Let in
Make step. The echo check for the score 0010 0011 (the score 2–3 stored as two 4-bit numbers) uses the same steps as before. The firewall rule uses two trusted addresses, written as documentation addresses: the pitch tablet 192.0.2.10 and the office computer 192.0.2.20.
TestType of dataTest dataExpected outcomeActual outcomePass/fail
1normal192.0.2.10Let inLet inpass
2normal192.0.2.20Let inLet inpass
3invalid192.0.2.99BlockBlockpass
4invalid (near miss)192.0.2.1BlockBlockpass
5invalid(nothing typed)BlockBlockpass
Test step. Work out the expected outcomes by hand first, before running anything. Then run each test and write the actual outcome. A good test plan has normal data (should be let in), invalid data (should be blocked) and a near miss.
QuestionAnswer
Does it meet the need?yes, for errors and for unknown devices
What is a weakness?the address list must be changed by hand
What would you improve?add a new address safely, and review the rules often
Evaluate step. The rule works for all five tests. But it checks only two addresses typed by hand, so adding a third device means changing the program. It also cannot check whether the sender is who it says it is. A model evaluation: “The plan meets both needs. To improve it, we could add a third address when a second tablet is bought, and keep the antivirus up to date.”
Class activity

Your own project (on paper). Invented problem: a choir sends the order of songs from the conductor’s laptop to a singer’s tablet before each concert. Step 1: list two risks and a method for each (echo check, firewall rule, antivirus). Step 2: write the echo-check steps for the 8-bit code 10010110, and a firewall rule with two trusted names, using example.org names. Step 3: write a test plan with five tests (normal, invalid, near miss) and work out the expected outcomes before checking. Step 4: write three sentences of evaluation. If you have a computer or tablet, ask an adult to help you run the Python rule. Never use real addresses or real people’s data.

Practice
1
Write expected outcomes for these tests of the club rule: 192.0.2.20; 192.0.2.200; a blank entry.
Test dataExpected outcome
192.0.2.20?
192.0.2.200?
(nothing typed)?
2
Find the mistake in this test plan row: test data 192.0.2.99, type normal, expected outcome Let in.
TestType of dataTest dataExpected outcome
1normal192.0.2.99Let in
3
Name one thing the firewall rule does well and one weakness.
4
The echo check shows the copy 00100111 for the sent score 00100011. Which bit changed, and what should the sender do?
Position12345678
sent00100011
copy00100111