{"base":{"id":"cs11-07","subject":"Programming","title":"Designing and testing a complete program","scene":"mix","steps":[{"use":"code10","mode":"decomp","eyebrow":"Decompose","title":"Break the problem down","body":"Split a large problem into input, process and output parts.","actions":[{"id":"split","label":"Split"}]},{"use":"code10","mode":"flow","eyebrow":"Design","title":"Flowchart","body":"Design each part as a flowchart or pseudocode before coding.","controls":[{"id":"age","label":"Age","min":1,"max":90,"step":1,"value":30}]},{"use":"py9","mode":"testplan","eyebrow":"Test plan","title":"Expected vs actual","body":"Plan tests with normal, boundary and erroneous data, then compare expected and actual results.","actions":[{"id":"one","label":"Run one test"},{"id":"all","label":"Run all"},{"id":"reset","label":"Reset"}]},{"use":"sys9","mode":"cycle","eyebrow":"Improve","title":"Design, build, test, feedback, improve","body":"Development is a cycle.","actions":[{"id":"step","label":"Step"},{"id":"reset","label":"Reset"}]},{"use":"py9","mode":"quiz","look":"testplan","eyebrow":"Check yourself","title":"Test data","body":"A program accepts ages 13 to 19. Which is erroneous test data?","question":"Choose one.","options":["13","\"seventeen\"","19"],"answer":1,"right":"Correct.","wrong":"Not quite."}],"more":[{"type":"cards","id":"worked","eyebrow":"Worked examples","title":"Step by step","items":[{"tag":"Requirements","title":"Library loans","body":"input member ID and book ID; check limits; record loan; print due date","code":true},{"tag":"Structure chart","title":"Top-down","body":"Library → Validate IDs · Check limit · Record loan · Print receipt","code":true},{"tag":"Test plan","title":"Limit 5 books","body":"normal: 3 → allowed; boundary: 5 → allowed, 6 → refused; erroneous: \"abc\" → error","code":true},{"tag":"Evaluate","title":"Questions","body":"Does it meet every requirement? Is it easy to use? What would you improve?","code":true}]},{"type":"cards","id":"mistakes","eyebrow":"Common mistakes","title":"Watch out for these","items":[{"tag":"Mistake","title":"Coding before planning","body":"Design first saves time fixing structure later."},{"tag":"Mistake","title":"Only testing normal data","body":"Boundary and erroneous data find more bugs."},{"tag":"Mistake","title":"Vague requirements","body":"Each requirement should be testable."}]},{"type":"cards","id":"deeper","eyebrow":"Go deeper","title":"More than the lesson","items":[{"tag":"Industry","title":"Agile","body":"Many teams build software in short \"sprints\", getting feedback every couple of weeks rather than waiting months."},{"tag":"Quality","title":"Automated tests","body":"Professional code often has thousands of automatic tests that run every time someone changes it."}]},{"type":"cards","id":"challenge","eyebrow":"Challenge yourself","title":"Stretch your brain","intro":"Try each one on paper before opening the card.","items":[{"tag":"Challenge","title":"Plan","body":"Write three requirements and a test for each for a cinema booking program.\n\nAnswer: e.g. seats 1–150 (test 150 and 151), name not empty (test \"\"), price shown correctly (test child and adult)."},{"tag":"Challenge","title":"Evaluate","body":"Give one limitation of a test plan.\n\nAnswer: it can only show the tests passed, not that no bugs remain."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Try it yourself","items":[{"title":"Mini project","time":"45 minutes","need":["Python"],"steps":["Choose a small program (e.g. tip calculator).","Write requirements, pseudocode and a test plan first.","Code, test and evaluate."],"why":"You follow the full development cycle.","safety":"None."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Eight more questions","questions":[{"question":"Decomposition means…","options":["deleting code","compiling","breaking a problem into parts"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"A structure chart shows…","options":["how a problem is broken into modules","file sizes","test results"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"Boundary data tests…","options":["random values","the edges of valid ranges","only normal values"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"A test plan includes…","options":["only code","only the user's name","expected and actual results"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Evaluation compares the program with…","options":["the requirements","other games","nothing"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"Erroneous data should be…","options":["accepted","rejected","ignored silently"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"Iterative development means…","options":["one long build","no testing","repeating design-build-test cycles"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Pseudocode is used to…","options":["plan logic before coding","run programs","store data"],"answer":0,"right":"Correct.","wrong":"Not quite."}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can…","items":["decompose a problem","design with flowcharts, pseudocode and structure charts","write a test plan with all data types","test and fix a program","evaluate against requirements"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"Requirement","meaning":"Something the program must do."},{"word":"Structure chart","meaning":"Diagram of modules in a program."},{"word":"Test plan","meaning":"Planned tests with expected results."},{"word":"Iterative","meaning":"Repeating cycles of improvement."}]},{"type":"sources","id":"sources","title":"Sources","items":["Raspberry Pi Foundation, Isaac Computer Science: software development","Agile Alliance: what is agile?","BBC Bitesize, GCSE Computer Science: testing","Python documentation: unittest"]}]},"overlay":null}