Week 29 · Unit 12: Be a problem solver · 3 lessons
3
Judge and make it better
Computing 6: Unit 12, pp. 162–177
GoalEvaluate a program against its requirements, record improvements and go round the stages to make a new version.
New words
evaluate · to check whether a program meets its requirements and to find what could be betterimprovement · a change that makes a program better for its usersversion · one stage in the history of a program, such as version 1 or version 2met · a word for a requirement that the program fulfils
Explanation
After testing, we evaluate. We take the list of requirements and check each one with evidence from the tests. We write down whether it is met or not met. We also ask the users what they think and note their ideas for improvements. If a requirement is not met, we go back to implementation, fix the problem and test again. If we have a good idea for an improvement, we write a new requirement and go round the stages once more. The new program is version 2. Keep the old version safe, so that you can go back if something goes wrong. Testing after every change makes sure that the fix did not break something else.
Requirement
Met?
Evidence
R1 asks three times
met
the test showed three prompts
R2 running total
met
trace table correct
R3 starts from 0
met
second run began at 0
R4 end message
met
tests with 49, 50 and 55 passed
Worked examples
Version
New requirement
Source
1
R1 to R4 as before
the first plan
2
R5: say how many coins are still needed
user feedback
The savings jar program meets all four requirements. The users say that they would like to see how many coins they still need. That becomes a new requirement for version 2.
For version 2 the design changes in the else part. With a total of 49 the program says Still needed: 1.
The stages form a cycle, and each trip round the cycle gives a new version.
Class activity
Evaluation clinic (no computer): swap the paper projects from the last lesson with another pair. Run their program with their test inputs and your own extra test. Fill in an evaluation table with each requirement, met or not met and the evidence. Tell them one good thing and one idea for improvement. When you get your own table back, decide which idea to use and write it as a new requirement. Write the change on your paper blocks and test version 2 with the same inputs. Did anything else change? If you have a computer or tablet, make version 2 of the savings jar in Scratch.
Practice
1
Which requirement is not met, and what should the programmer do next?
Requirement
Test result
R1 asks three times
asked twice
R2 shows the total
correct
R3 says Goal reached! at 50
correct
R1 is not met, because the program asked only twice. The programmer goes back to implementation, changes the loop to repeat 3 and tests again.
2
A user says ‘I cannot tell how much more I need to save’. Which stage does this feedback belong to? What would you do?
It belongs to evaluation. Write a new requirement, such as ‘say how many coins are still needed’, and go round the stages to make version 2.
3
Goal is 40. What does the program say when the total is 29?
40 − 29 = 11, so it says Still needed: 11.
4
Why must you run all the tests again after you fix a bug?
The fix may have changed something else. Running all the tests shows that the old parts still work.