HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Notes
  2. /Pseudocode, Trace Tables and Testing: Quick Revision
Computer Science

Pseudocode, Trace Tables and Testing: Quick Revision

A brief note on pseudocode, trace tables and testing: the exam style of pseudocode, dry runs, the four kinds of test data and how to find errors, with practice, a program and questions to check yourself.

StemPy LabWritten by StemPy Lab
Log in to save

A brief note on Pseudocode, Trace Tables and Testing. Read it before a test. Try each question at the end before you open its answer.

Pseudocode in the exam style

  • Keywords in capitals, names in mixed case (HighScore), comments after //.
  • Assignment: Total ← Total + Mark.
  • Selection: IF ... THEN ... ELSE ... ENDIF and CASE OF ... OTHERWISE ... ENDCASE.
  • Loops: FOR ... TO ... STEP ... NEXT (count-controlled), WHILE ... DO ... ENDWHILE (tests first), REPEAT ... UNTIL (runs at least once).
  • Operators: =, <>, <, <=, >, >=, AND, OR, NOT; DIV and MOD for whole-number division.

Trace tables

  • One column for each variable, and one for the output, which includes the prompts.
  • Write a value only when it changes. Start a new row for each pass of a loop.
  • Use the old value on the right of ←.

Test data

  • Normal: accepted, well inside the range.
  • Abnormal: should be rejected.
  • Extreme: the largest or smallest accepted value.
  • Boundary: the largest or smallest accepted value and its rejected neighbour.

Finding errors

Dry-run with simple data and compare with the expected result. Look for a wrong starting value, a wrong operator, a wrong loop limit, a statement in the wrong place or a missing statement. Write the corrected line.

Practice with new numbers

A program to try

Python has no REPEAT loop, so the program uses while True and leaves the loop with break when the UNTIL condition is true. It prints a row of a trace table on each pass.

Read it first. Then run it. How many passes does the loop make?

1. Change a = 11 to a = 3. Predict the output: does the body still run once?

Mistakes to avoid

  • = for assignment. Use ←.
  • Calling a rejected value extreme. Extreme data is always accepted.
  • Leaving prompts out of a trace table. They go in the OUTPUT column.
  • A loop limit one out. Check the first and the last pass.

Check yourself

  1. What does MOD(31, 7) return?
  1. A box holds 111 to 242424 eggs. Give the boundary data at the bottom of the range.
  1. Which loop always runs its body at least once?
  1. X ← 5, then WHILE X < 5 DO X ← X + 1 ENDWHILE. How many passes does the loop make?

Sources

  • Cambridge International, IGCSE Computer Science 0478 syllabus (2026, 2027 and 2028), unit 7 and section 4 (pseudocode).
← All Notes
← Planning a Program: Quick RevisionStandard Algorithms and Validation: Quick Revision →
More onComputer Science › Algorithms and Problem-Solving

Discussion (0)

Log in to join the discussion.

Loading…

On this page

  1. Pseudocode in the exam style
  2. Trace tables
  3. Test data
  4. Finding errors
  5. Practice with new numbers
  6. A program to try
  7. Mistakes to avoid
  8. Check yourself
  9. Sources

Goes with the lesson

  1. Test data and finding errorsPseudocode, Trace Tables and Testing

More notes on this topic

  1. Standard Algorithms and Validation: Quick Revision
  2. Planning a Program: Quick Revision
  3. Logic Circuits and Truth Tables: Quick Revision
  4. NAND, NOR and XOR Gates: Quick Revision
  5. NOT, AND and OR Gates: Quick Revision
All notes on this topic →