Producing Robust Programs | OCR GCSE Computer Science (J277)

Producing Robust Programs

  • 48 questions
  • 3 subtopics
  • J277/02
  • J277/02

Producing Robust Programs is examined in J277/02, Computational thinking, algorithms and programming.

It covers defensive design, input validation and authentication, writing maintainable code and testing, errors and test data.

Sample questions from Producing Robust Programs

Answer each one closed book first, then open the answer.

  1. Defensive design, input validation and authentication

    What do a presence check and a length check test?

    Show the answer
    A presence check makes sure a field has not been left empty. A length check makes sure the input has an allowed number of characters, such as at least 8.
  2. Defensive design, input validation and authentication

    How does verification differ from validation?

    Show the answer
    Verification checks that data has been entered exactly as intended, such as by typing a new password twice. Validation checks only that data follows the rules.
  3. Writing maintainable code

    What is camel case?

    Show the answer
    Camel case joins words without spaces and starts each word after the first with a capital letter. Examples are totalPrice and highScore.
  4. Writing maintainable code

    What is a comment?

    Show the answer
    A comment is a note in the code written for human readers. The translator ignores comments, so they do not change what the program does.
  5. Testing, errors and test data

    What is a logic error?

    Show the answer
    A logic error lets the program run but makes it give the wrong result. An example is a loop that stops one pass early, so the last item is never processed.
  6. Testing, errors and test data

    A program accepts whole-number percentages from 0 to 100. Suggest one normal, one boundary, one invalid and one erroneous test value.

    Show the answer
    A normal value is 57 and a boundary value is 0 or 100. An invalid value is 101 and an erroneous value is "ten".

The 3 subtopics

One subtopic is one session. Work down the list.

Subtopic What it covers Questions
Defensive design, input validation and authentication Defensive design and anticipating misuse, presence, length, range, type and format checks, validation loops, verification, and authentication in a login routine. 16
Writing maintainable code Why maintainability matters, sub programs, naming conventions and camel case, constants, indentation and comments, and what makes code easy for others to update. 16
Testing, errors and test data Iterative and final testing, syntax and logic errors, normal, boundary, invalid and erroneous test data with worked examples, and writing a test plan. 16
Producing Robust Programs is 48 of the 740 questions in the guide.Get the guide, £7

How the guide is worked

Answering a question from memory stores it far better than reading the answer again. The guide runs that as a fixed procedure on one subtopic at a time, about twenty minutes a session.

  1. Step 1 · Closed book

    Cover the answers. Work through one subtopic and write down what you can. Leave blanks where you have nothing.

  2. Step 2 · Open book

    Go back to the top. Read each printed answer and write it out in full, including the ones you had right.

  3. Step 3 · Closed book again

    Same questions, same order, from memory. The gap between pass one and pass three is the session result.

Read the full method, the return schedule and the research behind it.

Nearby topics

All 11 topics Guide overview

OCR GCSE Computer Science Active Recall Guide

Every topic, not just this one. 740 questions with their answers.

£7 GBP
Get the guide

Digital PDF, sent to the email address on your order.