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.
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.
Test
Type of data
Test data
Expected outcome
Actual outcome
Pass/fail
1
normal
192.0.2.10
Let in
Let in
pass
2
normal
192.0.2.20
Let in
Let in
pass
3
invalid
192.0.2.99
Block
Block
pass
4
invalid (near miss)
192.0.2.1
Block
Block
pass
5
invalid
(nothing typed)
Block
Block
pass
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.
Question
Answer
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 data
Expected outcome
192.0.2.20
?
192.0.2.200
?
(nothing typed)
?
192.0.2.20: Let in. 192.0.2.200: Block, because it is not one of the two addresses. Blank: Block.
2
Find the mistake in this test plan row: test data 192.0.2.99, type normal, expected outcome Let in.
Test
Type of data
Test data
Expected outcome
1
normal
192.0.2.99
Let in
192.0.2.99 is not one of the two trusted addresses, so it should be blocked, and the data is invalid, not normal. The expected outcome should be Block.
3
Name one thing the firewall rule does well and one weakness.
It stops every sender that is not on the list. A weakness is that the list is typed in by hand and must be changed when devices change.
4
The echo check shows the copy 00100111 for the sent score 00100011. Which bit changed, and what should the sender do?
Position
1
2
3
4
5
6
7
8
sent
0
0
1
0
0
0
1
1
copy
0
0
1
0
0
1
1
1
The sixth bit changed from 0 to 1. The sender should send the score again and compare the new copy.