{"base":{"id":"cs9-13","subject":"Programming","title":"Test plans and test data","scene":"py9","steps":[{"mode":"testkinds","eyebrow":"Kinds of test data","title":"Normal, boundary, invalid","body":"A program that accepts whole numbers from 1 to 10 should be tested with ordinary values, values at the edges and values it should reject."},{"mode":"testplan","eyebrow":"Run the test plan","title":"Expected vs actual","body":"Run the tests one at a time, or all at once. The plan records the expected and the actual result. Every test should pass.","actions":[{"id":"one","label":"Run one test"},{"id":"all","label":"Run all tests"},{"id":"reset","label":"Clear results"}]},{"mode":"mismatch","eyebrow":"Find the mismatch","title":"One test fails","body":"This version has a bug. Run all six tests. Which one fails, and what does that tell you about the code?","actions":[{"id":"one","label":"Run one test"},{"id":"all","label":"Run all tests"},{"id":"reset","label":"Clear results"}]},{"mode":"quiz","eyebrow":"Check yourself","title":"Boundary data","body":"A form accepts ages from 13 to 18.","question":"Which are boundary test values?","options":["15 and 16","0 and 100","13 and 18"],"answer":2,"right":"Correct. Boundary values sit exactly at the edges of the accepted range.","wrong":"Not quite. The edges of the range.","look":"testkinds"}],"more":[{"type":"cards","id":"ideas","eyebrow":"Popular idea vs science","title":"Common mix-ups","items":[{"tag":"Popular idea","title":"\"Testing with one normal value is enough.\"","body":"Bugs often appear only at boundaries or with invalid input."},{"tag":"Popular idea","title":"\"Invalid data means the program is broken.\"","body":"Invalid test data checks that the program rejects bad input safely."},{"tag":"Popular idea","title":"\"You write the expected result after running the test.\"","body":"Write it before; otherwise you can't spot a mismatch."}]},{"type":"cards","id":"code","eyebrow":"Test plan","title":"1 to 10","items":[{"tag":"Plan","title":"Columns","body":"Input | Type | Expected | Actual | Pass?\n5     | normal   | Accepted     |\n1     | boundary | Accepted     |\n11    | invalid  | Out of range |\nabc   | invalid  | Not a number |","code":true}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Test a friend's rule","items":[{"title":"Ticket machine test","time":"20 minutes","need":["Paper","A partner"],"steps":["Your partner invents a rule, e.g. 'children 5–15 pay half'.","Write a test plan with normal, boundary and invalid values and expected results.","Ask your partner to answer each case as the 'program'.","Did any answers not match what you expected?"],"why":"Writing expected results first is what makes testing useful.","safety":"No safety risks."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Six more questions","questions":[{"question":"Accepted range 1–100. Which is normal data?","options":["50","100","101"],"answer":0,"right":"Correct. An ordinary value inside the range.","wrong":"Not quite. Not at an edge."},{"question":"Accepted range 1–100. Which is invalid?","options":["0","1","100"],"answer":0,"right":"Correct. Just outside the range.","wrong":"Not quite. Outside the range."},{"question":"Which input is also invalid for a number field?","options":["10","\"ten\"","7"],"answer":1,"right":"Correct. The wrong type.","wrong":"Not quite. Is it a number?"},{"question":"A test plan's 'expected' column is filled in…","options":["after running","before running the tests","never"],"answer":1,"right":"Correct. So you can compare.","wrong":"Not quite. When do you predict?"},{"question":"10 should be accepted but isn't. The likely bug is…","options":["a missing print","a spelling error","< used instead of <="],"answer":2,"right":"Correct. The boundary is excluded.","wrong":"Not quite. Look at the comparison."},{"question":"Why test invalid data?","options":["To check bad input is handled safely","To make the program fail","It isn't needed"],"answer":0,"right":"Correct. Users make mistakes.","wrong":"Not quite. What if a user types nonsense?"}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can explain…","items":["what normal, boundary and invalid data are","how to write a test plan with expected results","how to run tests and record actual results","how a failed test points to a bug"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"test plan","meaning":"A table of tests with inputs and expected results."},{"word":"normal data","meaning":"Typical values that should be accepted."},{"word":"boundary data","meaning":"Values at the edges of the accepted range."},{"word":"invalid data","meaning":"Values that should be rejected."},{"word":"expected result","meaning":"What should happen, written before testing."}]},{"type":"sources","id":"sources","title":"Sources","items":["BBC Bitesize KS3 Computer Science","Raspberry Pi Foundation, Computing curriculum resources"]}]},"overlay":null}