Community resourceWorksheet

OCR H446 2.2.1 IDE development and debugging

Part 8 of 14 · H446 2.2.1 · Programming techniques

Naming IDE features earns little on its own; H446 2.2.1 rewards linking a feature to the evidence it produces. A podcast queue that drops its final episode drives a reproduce, predict, inspect, repair and retest routine, so breakpoints, watches and tests are each used for a stated purpose.

Students will:

  • distinguish syntax, runtime and logic errors from the behaviour observed
  • choose a breakpoint position and name the values worth watching there
  • explain what a variable watch shows that a passing or failing test does not
  • repair a loop so it processes every item, including empty and one-item lists
  • describe an investigation order that confirms a fault before any code is changed

Inside: 7 explanation cells, 2 multiple-choice questions, 1 fill-in-the-blanks cell, 2 written answers and 2 Python tasks. 16 marks, about 35 to 50 minutes.

Series: H446 2.2.1 · Programming techniques, part 8 of 14.

Shared by Coding PathwayVerified teacher

  • 14 cells
  • About 45 minutes
  • CC BY-SA 4.0
  • Shared 31 Aug 2026
  • Updated 1 Oct 2026

Preview

The whole resource, exactly as a class sees it. Answers and marking are held back.

IDE development and debugging

An integrated development environment (IDE) brings together tools for writing, translating, running and debugging code. In this worksheet, a podcast program runs but skips its final episode. You will use IDE features to gather evidence, locate the logic error and test the repair.

By the end, you will be able to

  • distinguish syntax, runtime and logic errors
  • choose a breakpoint and watched values
  • step through a fault in execution order
  • design unit tests for ordinary and boundary cases

Development tools and debugging tools

An IDE combines tools in one environment, but an examination question may ask for a particular purpose. Name a feature only when it matches that purpose.

Tools that support writing and running code

  • A code editor provides one place to create and change source code.
  • Autocomplete suggests known names or language structures, reducing some typing and naming errors.
  • Syntax highlighting makes tokens and structure easier to distinguish. It becomes debugging evidence only when a suspicious token is highlighted differently.
  • Diagnostics report detected problems with a location and useful message.
  • A translator/runtime lets the developer translate or execute the program.

Tools used to investigate behaviour

  • A breakpoint pauses at a chosen statement.
  • Stepping runs one statement at a time after pausing.
  • A variable watch displays selected runtime values as they change.
  • Unit tests compare a small component's actual results with expected results.

A syntax error breaks language rules; a runtime error occurs during execution; a logic error allows execution but produces the wrong behaviour. Do not answer a debugging question with a writing aid unless you explain the diagnostic evidence it reveals.

Model a debugging workflow

Symptom: the final episode is missing.

  1. Reproduce the problem with a three-item list.
  2. Predict the valid indexes: 0, 1 and 2.
  3. Set a breakpoint inside the loop.
  4. Step through the loop while a watch shows index and len(episodes).
  5. Observe that index reaches only 0 and 1.
  6. Repair the loop bound, then run unit tests with empty, one-item and three-item lists.

Autocomplete might prevent a mistyped name, but it cannot show why the final index is skipped. Link every selected feature to an action and the evidence that action produces.

Worked diagnosis

Suppose the expected result is all three episode names, but the program returns only the first two without raising an exception. That evidence rules out a syntax failure and points to a logic error.

Use this workflow:

  1. Run a focused test with three items.
  2. Pause inside the loop.
  3. Step through the loop while watching index and len(episodes).
  4. Observe that index never reaches 2.
  5. Correct the loop bound.
  6. Retest with empty, one-item and three-item lists.

Each tool contributes different evidence.

Multiple choice1 mark

The podcast program runs without an exception but omits the final episode. What type of error is this?

  • ASyntax error
  • BRuntime error
  • CLogic error
  • DTranslation error
Multiple choice1 mark

To inspect index immediately before an incorrect list access, which feature is most directly useful?

  • AAutocomplete
  • BColour theme
  • CFile compression
  • DBreakpoint with variable watch
Worked example
def play_order(episodes):
    played = []
    for index in range(len(episodes) - 1):
        played.append(episodes[index])
    return played

print(play_order(["Intro", "Interview", "Credits"]))
Written answer3 marks

Choose a line for a breakpoint and state what values you would watch to confirm why the final episode is skipped.

Link the pause point and values to the loop bound.

Students type their answer here.

Repair and test

Correct play_order so it returns every episode in the same order, including empty and one-item lists.

Coding task3 marks
def play_order(episodes):
    played = []
    for index in range(len(episodes) - 1):
        played.append(episodes[index])
    return played
Written answer4 marks

Explain how unit testing and a variable watch contribute different evidence while debugging this function.

State what each reveals in this specific program.

Students type their answer here.

Checkpoint

Complete the debugging workflow from memory. There is no answer bank, and correctness is withheld until teacher review.

Fill in the blanks4 marks
A checkpoint gap 1 pauses execution at a chosen statement. checkpoint gap 2 then executes one statement at a time. A variable checkpoint gap 3 displays selected runtime values, while a unit checkpoint gap 4 compares a component's actual result with an expected result.

Review your understanding

Before submitting, check that you can explain the main distinction in your own words, apply it in an unfamiliar context and justify the resulting behaviour or consequence.