Developing and Testing Code | Edexcel International GCSE Computer Science (4CP0)

Guide overview All 20 topics Sample questions Papers and weighting Look inside Questions and answers

Developing and Testing Code

  • 37 questions
  • 4 subtopics
  • Paper 1
  • Paper 2

Developing and Testing Code is examined in Paper 1, Principles of Computer Science, and Paper 2, Application of Computational Thinking.

It covers writing readable programs; types of error; testing and test data; and trace tables and improving programs.

Sample questions from Developing and Testing Code

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

  1. Writing readable programs

    What is a high-level programming language?

    Show the answer
    A high-level programming language uses English-like keywords and is independent of the computer's hardware, such as Python, C# or Java.
  2. Writing readable programs

    Why are comments added to code?

    Show the answer
    Comments explain what each part of the program does. The translator ignores comments, so they do not change how the program runs.
  3. Types of error

    Name the three types of error in programs.

    Show the answer
    The three types are syntax errors, logic errors and runtime errors.
  4. Types of error

    What type of error is the Python line if score > 50 print('Pass'), which has no colon?

    Show the answer
    The line contains a syntax error, because Python requires a colon after an if condition. The program cannot be translated until the colon is added.
  5. Testing and test data

    What is a test plan?

    Show the answer
    A test plan lists the tests to be carried out, the test data to use and the expected result of each test.
  6. Testing and test data

    What is boundary test data?

    Show the answer
    Boundary test data is data at the edge of the valid range, such as the largest and smallest values that should be accepted.
  7. Trace tables and improving programs

    How is a trace table used to find a variable's value?

    Show the answer
    Each column holds a variable and each row a step of the program. The programmer fills in the values to find what each variable holds at any point.
  8. Trace tables and improving programs

    How does adding validation improve a program?

    Show the answer
    Validation stops invalid data entering the program. Errors and crashes later in the program are avoided.

The 4 subtopics

One subtopic is one session. Work down the list.

Subtopic What it covers Questions
Writing readable programs High-level languages, and how comments, descriptive names and indentation make programs easier to read and maintain. 8
Types of error Syntax, logic and runtime errors, Python error messages such as NameError and TypeError, and how to locate and fix each. 12
Testing and test data Test plans and normal, boundary and erroneous test data, with worked test data for given ranges. 9
Trace tables and improving programs Using trace tables to find what a variable holds, and judging a program's strengths and weaknesses to suggest improvements. 8
Developing and Testing Code is 37 of the 819 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.

Around this topic

All 20 topics Guide overview

Edexcel International GCSE Computer Science Active Recall Guide

Developing and Testing Code and every other topic, with the answers printed after each section.

£7 GBP
Get the guide

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