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

Following a project plan

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.

RequirementMet?Evidence
R1 asks three timesmetthe test showed three prompts
R2 running totalmettrace table correct
R3 starts from 0metsecond run began at 0
R4 end messagemettests with 49, 50 and 55 passed
Worked examples
VersionNew requirementSource
1R1 to R4 as beforethe first plan
2R5: say how many coins are still neededuser 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.
sayGoal reached!for2secondssayjoinStill needed: 50-totalfor2secondsiftotal>49thenelse
For version 2 the design changes in the else part. With a total of 49 the program says Still needed: 1.
version 1 planbuild and testevaluate and listenversion 2 plan
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?
RequirementTest result
R1 asks three timesasked twice
R2 shows the totalcorrect
R3 says Goal reached! at 50correct
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?
3
Goal is 40. What does the program say when the total is 29?
sayGoal reached!for2secondssayjoinStill needed: 40-totalfor2secondsiftotal>39thenelse
4
Why must you run all the tests again after you fix a bug?