Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Programming project: selection II

      Lesson details

      Learning outcome

      I can implement a solution to a problem that requires the use of selection.

      Key learning points

      1. Testing a program can help you to identify and spot errors.
      2. A test plan is a document that sets out the tests that will be carried out during testing.
      3. Once testing is complete, a program can be refined to correct any errors and make improvements.

      Keywords

      • Test plan - a document that sets out the tests that will be carried out during testing

      • Syntax error - an error where the code has been structured incorrectly and the syntax rules haven’t been followed

      • Logic error - an error where the program will run, but won’t do what the programmer expected

      Common misconception

      If a program has a logic error it will not work and will give error messages.

      Logic errors are errors that cause a program to work incorrectly or unexpectedly. With a logic error, the program can be run without failing, but it does not return the expected result. The user might not realise that there is an error.

      Teacher tip

      This is the second lesson of a project to allow pupils to apply their understanding of selection. It would be benefical if pupils have completed part I before attempting this lesson.

      Equipment

      Pupils will need access to a device that can edit and run Python programs. Examples in this lesson use the RPF Code Editor https://oak.link/python-editor

      Licence

      This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      is a way of expressing an algorithm that is independent of a specific programming language.

      Correct Answer: pseudocode

      Q2.
      What is the missing stage of the software development life cycle? Planning, analysis, , development, testing, implementation.

      Correct Answer: design

      Q3.
      At which stage of the software development life cycle do you start to create a program?

      analysis
      design
      Correct answer: development
      testing

      Q4.
      What is nested selection in programming?

      a type of loop that repeats a block of code
      Correct answer: a selection statement placed inside another selection statement
      a way to store multiple values in a list

      Q5.
      Match the logical operator to its function.

      Correct Answer:AND,returns True if both conditions are True

      returns True if both conditions are True

      Correct Answer:OR,returns True if at least one condition is True

      returns True if at least one condition is True

      Correct Answer:NOT,reverses the result of a condition

      reverses the result of a condition

      Q6.
      Match the relational operator to its meaning.

      Correct Answer:>,greater than

      greater than

      Correct Answer:<,less than

      less than

      Correct Answer:==,equal to

      equal to

      Correct Answer:!=,not qual to

      not qual to

      Correct Answer:>=,greater than or equal to

      greater than or equal to

      Correct Answer:<=,less than or equal to

      less than or equal to

      6 Questions

      Q1.
      What is the purpose of a test plan in programming?

      to write the actual program code
      to design the user interface
      Correct answer: to set out the tests that will be carried out during testing
      to decide how the project will be implemented

      Q2.
      A error occurs when the program may run, but does not perform as expected.

      Correct Answer: logic

      Q3.
      A error happens when the program has incorrect syntax and will not run.

      Correct Answer: syntax

      Q4.
      Match the test data type to its description.

      Correct Answer:normal,values that should be accepted as they are valid

      values that should be accepted as they are valid

      Correct Answer:erroneous,values that should not be accepted and will cause an error

      values that should not be accepted and will cause an error

      Correct Answer:boundary,values that are at the edge of being valid

      values that are at the edge of being valid

      Q5.
      Which of the following is an example of erroneous test data for a program that asks for an age (expected input: an integer)?

      25
      0
      Correct answer: twenty-five
      18

      Q6.
      In the software development life cycle, is the stage that follows development and involves checking for errors.

      Correct Answer: testing

      To help you plan your 10 computer science lesson on: Programming project: selection II, download all teaching resources for free and adapt to suit your pupils' needs...