AeroLab Reading room

CS / IGCSE

Programming, testing and problem solving

Variables have data types, and programs use arithmetic, Boolean conditions, loops, arrays and procedures. Pseudocode communicates an algorithm without requiring one executable language.

Learning objectives

The big idea

Variables have data types, and programs use arithmetic, Boolean conditions, loops, arrays and procedures. Pseudocode communicates an algorithm without requiring one executable language.

Decomposition, validation, verification and systematic test data support reliable programs. Normal, boundary and invalid cases test different behaviours; a trace table reveals how state changes.

Worked example

A loop adds integers 1 through 4 to total=0. What is the final total?

Follow the solution

The running totals are 1, 3, 6 and 10.

Investigate and explain

Predict the worked result before calculating. Change one input, record the new result, and explain which assumptions still hold.

Use the prediction activity below; a local model appears only where it supports this topic.

Open the interactive investigation

Check your understanding

1. Which checks whether an age lies between 0 and 120?

  1. Range validation
  2. Spell checking
  3. Compression
Check the answer and reasoning

Range validation

A range check rejects values outside specified bounds, though an accepted value may still be false.

2. A loop adds integers 1 through 4 to total=0. What is the final total?

  1. 4
  2. 10
  3. 6
Check the answer and reasoning

10

The running totals are 1, 3, 6 and 10.

3. Does passing a few tests prove all inputs work?

  1. Yes
  2. Only for integers
  3. No
Check the answer and reasoning

No

Tests sample behaviours; rigorous reasoning and suitable coverage are still needed.