OCR J277 · Computational thinking, algorithms and programming
Testing and refinement revision
Plan tests with expected results, choose normal, boundary and erroneous data, and use failures to improve programs.
What to know about testing and refinement
Test against requirements
A test plan states what is being tested, the input/setup, the expected result and then the actual result. Work out the expected result from the requirements before executing the program. If you simply copy the actual output into the expected column, the test cannot expose a faulty algorithm.
Choose complementary data
Normal data is representative valid input. Boundary data tests the edges of accepted ranges; inspect valid extremes and immediately invalid values outside them. Erroneous data breaks a rule, such as the wrong type, format or range. For a whole-number limit 5–20, useful values include normal 12, edges 5 and 20, just-outside 4 and 21, and text where a number is required.
Focus areas: Testing and refinement.
Test yourself: questions and answers
Answer each prompt from memory before opening the explanation. These 4 samples come from this topic's 9 original retrieval cards.
When should an expected test result be established?
Before running the program, from the requirements.
What is normal test data?
Representative input that meets the stated rules.
Which values test both inclusive boundaries of an accepted range 5–20?
5 and 20.
What is erroneous test data?
Data that fails a stated input rule, such as an invalid type or out-of-range value.
Turn this topic into a revision session
- Explain one idea without looking at the notes.
- Compare your answer with the guidance and identify the missing link.
- Apply it in a question or short program, then revisit it after a delay.
Free accounts choose one revision topic pack. Pro includes all 26 packs in this course and both published qualifications. Public samples and coding practice are free; PDF guides are separate purchases.
Create a free accountSpecification and sources
Check the required scope against the official OCR J277 specification (PDF). RecallStride's explanations and examples are independent learning resources. See our editorial policy or report a correction, including the topic code and statement concerned.